Forráskód Böngészése

make memrchr detection more general as some linux libcs such as musl or diet do not have memrchr either

Schanzenbach, Martin 5 éve
szülő
commit
48ae3fd973
3 módosított fájl, 4 hozzáadás és 3 törlés
  1. 2 0
      configure.ac
  2. 2 1
      src/include/compat.h
  3. 0 2
      src/include/platform.h

+ 2 - 0
configure.ac

@@ -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]))

+ 2 - 1
src/include/compat.h

@@ -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
 }

+ 0 - 2
src/include/platform.h

@@ -70,9 +70,7 @@
 
 #define VERBOSE_STATS 0
 
-#if (defined WINDOWS) || (defined DARWIN)
 #include "compat.h"
-#endif
 
 #ifdef CYGWIN
 #include <sys/reent.h>