bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] bypass broken inline strtod() definition in <stdlib.h> on Mi


From: Ben Pfaff
Subject: Re: [PATCH] bypass broken inline strtod() definition in <stdlib.h> on Mingw
Date: Mon, 14 Jun 2010 17:17:55 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Bruno Haible <address@hidden> writes:

>   1) to apply the patch below,
>   2) to use the common idiom
>         if test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1; then
>      like you did above,
>   3) to improve the cross-compiling guess.

Here is #3:

>From 60471b91b5dbdf2c24c258640cee6dfdb32c4d6f Mon Sep 17 00:00:00 2001
From: Ben Pfaff <address@hidden>
Date: Mon, 14 Jun 2010 17:15:41 -0700
Subject: [PATCH] strtod: Assume strtod() works when cross-compiling to 
new-enough glibc.

---
 ChangeLog    |    4 +++-
 m4/strtod.m4 |   14 +++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6192b4d..3090162 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 2010-06-14  Ben Pfaff  <address@hidden>
 
-       * m4/strtod.m4 (gl_FUNC_STRTOD): Factor out common code.
+       * m4/strtod.m4 (gl_FUNC_STRTOD): Factor out common code.  Assume
+       that strtod() works when cross-compiling to a glibc version known
+       to work.
 
 2010-06-13  Bruno Haible  <address@hidden>
 
diff --git a/m4/strtod.m4 b/m4/strtod.m4
index 36b5d2d..aa6a1c5 100644
--- a/m4/strtod.m4
+++ b/m4/strtod.m4
@@ -95,7 +95,19 @@ 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
     fi
-- 
1.7.1


-- 
Ben Pfaff 
http://benpfaff.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]