diff options
author | LRN <lrn1986@gmail.com> | 2013-08-16 04:08:14 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-08-16 04:08:14 +0000 |
commit | 37284be800eef44babef8fc3cc0461c0d3cbea67 (patch) | |
tree | dcc7f426174f8799105be02d6010c82fd9c9fff0 /src/gns/gnunet-service-gns_resolver.c | |
parent | 97be3496f58818aba53e64ab78877341bf4ce7e8 (diff) | |
download | gnunet-37284be800eef44babef8fc3cc0461c0d3cbea67.tar.gz gnunet-37284be800eef44babef8fc3cc0461c0d3cbea67.zip |
Fix the lack of memrchr on W32
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.c')
-rw-r--r-- | src/gns/gnunet-service-gns_resolver.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 6d77997e7..c36fa8d17 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c | |||
@@ -1324,6 +1324,18 @@ fail_resolution (void *cls, | |||
1324 | GNS_resolver_lookup_cancel (rh); | 1324 | GNS_resolver_lookup_cancel (rh); |
1325 | } | 1325 | } |
1326 | 1326 | ||
1327 | #ifdef WINDOWS | ||
1328 | /* Don't have this on W32, here's a naive implementation */ | ||
1329 | void *memrchr (const void *s, int c, size_t n) | ||
1330 | { | ||
1331 | size_t i; | ||
1332 | unsigned char *ucs = (unsigned char *) s; | ||
1333 | for (i = n - 1; i >= 0; i--) | ||
1334 | if (ucs[i] == c) | ||
1335 | return (void *) &ucs[i]; | ||
1336 | return NULL; | ||
1337 | } | ||
1338 | #endif | ||
1327 | 1339 | ||
1328 | /** | 1340 | /** |
1329 | * Get the next, rightmost label from the name that we are trying to resolve, | 1341 | * Get the next, rightmost label from the name that we are trying to resolve, |