(x)memcoll: speedup when input is known to be NUL delimited
[pspp] / m4 / strtod.m4
index 00b8e64b41cb001348f561c9e6eedb2951ae951a..aa6a1c53d50bdee99bcc6d47c625c410b1757c5d 100644 (file)
@@ -15,9 +15,6 @@ AC_DEFUN([gl_FUNC_STRTOD],
   AC_CHECK_DECLS_ONCE([strtod])
   if test $ac_cv_have_decl_strtod != yes; then
     HAVE_STRTOD=0
-    gl_PREREQ_STRTOD
-    dnl Use undocumented macro to set POW_LIB correctly.
-    _AC_LIBOBJ_STRTOD
   else
     AC_CACHE_CHECK([whether strtod obeys C99], [gl_cv_func_strtod_works],
       [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
@@ -98,14 +95,28 @@ numeric_equal (double x, double y)
 ]])],
         [gl_cv_func_strtod_works=yes],
         [gl_cv_func_strtod_works=no],
-        [gl_cv_func_strtod_works="guessing no"])])
+        [dnl The last known bugs in glibc strtod(), as of this writing,
+        dnl were fixed in version 2.8
+         AC_EGREP_CPP([Lucky user],
+           [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)
+  Lucky user
+ #endif
+#endif
+           ],
+           [gl_cv_func_strtod_works=yes],
+           [gl_cv_func_strtod_works="guessing no"])])])
     if test "$gl_cv_func_strtod_works" != yes; then
       REPLACE_STRTOD=1
-      gl_PREREQ_STRTOD
-      dnl Use undocumented macro to set POW_LIB correctly.
-      _AC_LIBOBJ_STRTOD
     fi
   fi
+  if test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1; then
+    gl_PREREQ_STRTOD
+    dnl Use undocumented macro to set POW_LIB correctly.
+    _AC_LIBOBJ_STRTOD
+  fi
 ])
 
 # Prerequisites of lib/strtod.c.