make memrchr detection more general as some linux libcs such as musl or diet do not...
authorSchanzenbach, Martin <mschanzenbach@posteo.de>
Tue, 5 Feb 2019 08:10:56 +0000 (09:10 +0100)
committerSchanzenbach, Martin <mschanzenbach@posteo.de>
Tue, 5 Feb 2019 08:10:56 +0000 (09:10 +0100)
configure.ac
src/include/compat.h
src/include/platform.h

index 4295ce0bab791c1e6f8a09275f114c160bb5ee10..3355812f662bc34b9091956955248932e87fedfc 100644 (file)
@@ -192,6 +192,8 @@ AC_UNALIGNED_64_ACCESS
 
 # some other checks for standard libs
 AC_SEARCH_LIBS([gethostbyname], [nsl ws2_32])
+AC_SEARCH_LIBS([memrchr], [], [],
+               AC_DEFINE(HAVE_MEMRCHR,1,[memrchr supported]))
 AC_CHECK_LIB(socket, socket)
 AC_CHECK_LIB(m, log)
 AC_CHECK_LIB(c, getloadavg, AC_DEFINE(HAVE_GETLOADAVG,1,[getloadavg supported]))
index 31a9760c5a0f6e88fe045aa15ff6014296024648..b24d096535e5eb937957c1da3d080dc73668b329 100644 (file)
@@ -44,8 +44,9 @@ void*
 GN_memrchr_ (const void *s,
              int c,
              size_t n);
-
+#ifndef HAVE_MEMRCHR
 #define memrchr(s,c,n) GN_memrchr_(s,c,n)
+#endif
 
 #ifdef __cplusplus
 }
index b0a7c0a474d5bbabb00d87f4d041b431c10cb9a7..6ea70dc6c4aaef161fbcb9878d9a8f1ad6fc5816 100644 (file)
@@ -70,9 +70,7 @@
 
 #define VERBOSE_STATS 0
 
-#if (defined WINDOWS) || (defined DARWIN)
 #include "compat.h"
-#endif
 
 #ifdef CYGWIN
 #include <sys/reent.h>