aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-08-16 04:08:14 +0000
committerLRN <lrn1986@gmail.com>2013-08-16 04:08:14 +0000
commit37284be800eef44babef8fc3cc0461c0d3cbea67 (patch)
treedcc7f426174f8799105be02d6010c82fd9c9fff0
parent97be3496f58818aba53e64ab78877341bf4ce7e8 (diff)
downloadgnunet-37284be800eef44babef8fc3cc0461c0d3cbea67.tar.gz
gnunet-37284be800eef44babef8fc3cc0461c0d3cbea67.zip
Fix the lack of memrchr on W32
-rw-r--r--src/gns/gnunet-service-gns_resolver.c12
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 */
1329void *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,