c-strtold: Avoid link error on AIX 7.
authorBruno Haible <bruno@clisp.org>
Fri, 19 Nov 2010 00:57:49 +0000 (01:57 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 19 Nov 2010 00:57:49 +0000 (01:57 +0100)
* lib/c-strtod.c: Test also HAVE_STRTOD_L or HAVE_STRTOLD_L.
* m4/c-strtod.m4 (gl_C_STRTOD): Test whether strtod_l exists.
(gl_C_STRTOLD): Test whether strtold_l exists.
Reported by Albert Chin <bug-gnulib@mlists.thewrittenword.com>.

ChangeLog
lib/c-strtod.c
m4/c-strtod.m4

index 0ab0af3..7f0d117 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-11-18  Bruno Haible  <bruno@clisp.org>
+
+       c-strtold: Avoid link error on AIX 7.
+       * lib/c-strtod.c: Test also HAVE_STRTOD_L or HAVE_STRTOLD_L.
+       * m4/c-strtod.m4 (gl_C_STRTOD): Test whether strtod_l exists.
+       (gl_C_STRTOLD): Test whether strtold_l exists.
+       Reported by Albert Chin <bug-gnulib@mlists.thewrittenword.com>.
+
 2010-11-17  Paul Eggert  <eggert@cs.ucla.edu>
 
        intprops: new macro INT_BITS_STRLEN_BOUND
index 38d472b..8bc7f15 100644 (file)
@@ -43,7 +43,7 @@
 # define STRTOD strtod
 #endif
 
-#ifdef LC_ALL_MASK
+#if defined LC_ALL_MASK && (LONG ? HAVE_STRTOLD_L : HAVE_STRTOD_L)
 
 /* Cache for the C locale object.
    Marked volatile so that different threads see the same value
@@ -67,7 +67,7 @@ C_STRTOD (char const *nptr, char **endptr)
 {
   DOUBLE r;
 
-#ifdef LC_ALL_MASK
+#if defined LC_ALL_MASK && (LONG ? HAVE_STRTOLD_L : HAVE_STRTOD_L)
 
   locale_t locale = c_locale ();
   if (!locale)
index 41cf18e..0f367f6 100644 (file)
@@ -1,4 +1,4 @@
-# c-strtod.m4 serial 11
+# c-strtod.m4 serial 12
 
 # Copyright (C) 2004-2006, 2009-2010 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -39,6 +39,7 @@ AC_DEFUN([gl_C_STRTOD],
 
   dnl Prerequisites of lib/c-strtod.c.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_CHECK_FUNCS([strtod_l])
 
   AC_REQUIRE([AC_C_INLINE])
   :
@@ -51,6 +52,7 @@ AC_DEFUN([gl_C_STRTOLD],
   dnl Prerequisites of lib/c-strtold.c.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_REQUIRE([gl_C99_STRTOLD])
+  AC_CHECK_FUNCS([strtold_l])
 
   AC_REQUIRE([AC_C_INLINE])
   :