Mercurial > gnulib
annotate m4/strtod.m4 @ 40196:e63f5d3edab5
relocatable-prog: Update documentation.
* doc/relocatable-maint.texi (Supporting Relocation): Update to match
the recent changes.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 24 Feb 2019 01:49:15 +0100 |
parents | 31ab89a208b9 |
children |
rev | line source |
---|---|
40172
31ab89a208b9
strtod, strtold: Use the locale's decimal point.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
1 # strtod.m4 serial 24 |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 dnl Copyright (C) 2002-2003, 2006-2019 Free Software Foundation, Inc. |
5611
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4691
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4691
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
87c42e194f4a
Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents:
4691
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7 AC_DEFUN([gl_FUNC_STRTOD], |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 [ |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
9 AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) |
18993
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
10 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles |
14616
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
11 m4_ifdef([gl_FUNC_STRTOD_OBSOLETE], [ |
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
12 dnl Test whether strtod is declared. |
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
13 dnl Don't call AC_FUNC_STRTOD, because it does not have the right guess |
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
14 dnl when cross-compiling. |
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
15 dnl Don't call AC_CHECK_FUNCS([strtod]) because it would collide with the |
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
16 dnl ac_cv_func_strtod variable set by the AC_FUNC_STRTOD macro. |
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
17 AC_CHECK_DECLS_ONCE([strtod]) |
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
18 if test $ac_cv_have_decl_strtod != yes; then |
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
19 HAVE_STRTOD=0 |
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
20 fi |
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
21 ]) |
ffa170f6f764
strtod: Remove check for strtod, unless supporting old platforms.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
22 if test $HAVE_STRTOD = 1; then |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
23 AC_CACHE_CHECK([whether strtod obeys C99], [gl_cv_func_strtod_works], |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
24 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
25 #include <stdlib.h> |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
26 #include <math.h> |
11210 | 27 #include <errno.h> |
9929
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
28 /* Compare two numbers with ==. |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
29 This is a separate function because IRIX 6.5 "cc -O" miscompiles an |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
30 'x == x' test. */ |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
31 static int |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
32 numeric_equal (double x, double y) |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
33 { |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
34 return x == y; |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
35 } |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
36 ]], [[ |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13885
diff
changeset
|
37 int result = 0; |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
38 { |
13425
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
39 /* In some old versions of Linux (2000 or before), strtod mis-parses |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
40 strings with leading '+'. */ |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
41 const char *string = " +69"; |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
42 char *term; |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
43 double value = strtod (string, &term); |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
44 if (value != 69 || term != (string + 4)) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13885
diff
changeset
|
45 result |= 1; |
13425
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
46 } |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
47 { |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
48 /* Under Solaris 2.4, strtod returns the wrong value for the |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
49 terminating character under some conditions. */ |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
50 const char *string = "NaN"; |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
51 char *term; |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
52 strtod (string, &term); |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
53 if (term != string && *(term - 1) == 0) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13885
diff
changeset
|
54 result |= 2; |
13425
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
55 } |
e2b2ba442532
strtod: Stop using AC_FUNC_STRTOD.
Bruno Haible <bruno@clisp.org>
parents:
13149
diff
changeset
|
56 { |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
57 /* Older glibc and Cygwin mis-parse "-0x". */ |
9871
faf4392efa56
Improve strtod bug detection check.
Eric Blake <ebb9@byu.net>
parents:
9821
diff
changeset
|
58 const char *string = "-0x"; |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
59 char *term; |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
60 double value = strtod (string, &term); |
9898
02bfc9acab82
Work around Solaris 10 math.h bug.
Eric Blake <ebb9@byu.net>
parents:
9871
diff
changeset
|
61 double zero = 0.0; |
02bfc9acab82
Work around Solaris 10 math.h bug.
Eric Blake <ebb9@byu.net>
parents:
9871
diff
changeset
|
62 if (1.0 / value != -1.0 / zero || term != (string + 2)) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13885
diff
changeset
|
63 result |= 4; |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
64 } |
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
65 { |
9871
faf4392efa56
Improve strtod bug detection check.
Eric Blake <ebb9@byu.net>
parents:
9821
diff
changeset
|
66 /* Many platforms do not parse hex floats. */ |
faf4392efa56
Improve strtod bug detection check.
Eric Blake <ebb9@byu.net>
parents:
9821
diff
changeset
|
67 const char *string = "0XaP+1"; |
faf4392efa56
Improve strtod bug detection check.
Eric Blake <ebb9@byu.net>
parents:
9821
diff
changeset
|
68 char *term; |
faf4392efa56
Improve strtod bug detection check.
Eric Blake <ebb9@byu.net>
parents:
9821
diff
changeset
|
69 double value = strtod (string, &term); |
faf4392efa56
Improve strtod bug detection check.
Eric Blake <ebb9@byu.net>
parents:
9821
diff
changeset
|
70 if (value != 20.0 || term != (string + 6)) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13885
diff
changeset
|
71 result |= 8; |
9871
faf4392efa56
Improve strtod bug detection check.
Eric Blake <ebb9@byu.net>
parents:
9821
diff
changeset
|
72 } |
faf4392efa56
Improve strtod bug detection check.
Eric Blake <ebb9@byu.net>
parents:
9821
diff
changeset
|
73 { |
11210 | 74 /* Many platforms do not parse infinities. HP-UX 11.31 parses inf, |
75 but mistakenly sets errno. */ | |
9871
faf4392efa56
Improve strtod bug detection check.
Eric Blake <ebb9@byu.net>
parents:
9821
diff
changeset
|
76 const char *string = "inf"; |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
77 char *term; |
11212
8233c503d99e
strtod: avoid C99 decl-after-statement
Gary V. Vaughan <gary@gnu.org>
parents:
11210
diff
changeset
|
78 double value; |
11210 | 79 errno = 0; |
11212
8233c503d99e
strtod: avoid C99 decl-after-statement
Gary V. Vaughan <gary@gnu.org>
parents:
11210
diff
changeset
|
80 value = strtod (string, &term); |
11210 | 81 if (value != HUGE_VAL || term != (string + 3) || errno) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13885
diff
changeset
|
82 result |= 16; |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
83 } |
9929
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
84 { |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
85 /* glibc 2.7 and cygwin 1.5.24 misparse "nan()". */ |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
86 const char *string = "nan()"; |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
87 char *term; |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
88 double value = strtod (string, &term); |
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
89 if (numeric_equal (value, value) || term != (string + 5)) |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13885
diff
changeset
|
90 result |= 32; |
9929
357b15084942
Adjust strtod detection to catch glibc 2.7 bug.
Eric Blake <ebb9@byu.net>
parents:
9898
diff
changeset
|
91 } |
12247 | 92 { |
93 /* darwin 10.6.1 misparses "nan(". */ | |
94 const char *string = "nan("; | |
95 char *term; | |
96 double value = strtod (string, &term); | |
97 if (numeric_equal (value, value) || term != (string + 3)) | |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13885
diff
changeset
|
98 result |= 64; |
12247 | 99 } |
13918
d5a74c6ec06b
Put more information about failed tests into the test return codes.
Bruno Haible <bruno@clisp.org>
parents:
13885
diff
changeset
|
100 return result; |
9821
18bab9955c43
Document various strtod bugs, with some fixes.
Eric Blake <ebb9@byu.net>
parents:
7942
diff
changeset
|
101 ]])], |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12247
diff
changeset
|
102 [gl_cv_func_strtod_works=yes], |
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
12247
diff
changeset
|
103 [gl_cv_func_strtod_works=no], |
13427
727e17a1e8b3
strtod: Assume strtod() works when cross-compiling to new-enough glibc.
Ben Pfaff <blp@cs.stanford.edu>
parents:
13426
diff
changeset
|
104 [dnl The last known bugs in glibc strtod(), as of this writing, |
15338
03e2cd1cbbe8
maint: indent with spaces, not TABs, and add a rule to check this
Jim Meyering <meyering@redhat.com>
parents:
15113
diff
changeset
|
105 dnl were fixed in version 2.8 |
13427
727e17a1e8b3
strtod: Assume strtod() works when cross-compiling to new-enough glibc.
Ben Pfaff <blp@cs.stanford.edu>
parents:
13426
diff
changeset
|
106 AC_EGREP_CPP([Lucky user], |
727e17a1e8b3
strtod: Assume strtod() works when cross-compiling to new-enough glibc.
Ben Pfaff <blp@cs.stanford.edu>
parents:
13426
diff
changeset
|
107 [ |
727e17a1e8b3
strtod: Assume strtod() works when cross-compiling to new-enough glibc.
Ben Pfaff <blp@cs.stanford.edu>
parents:
13426
diff
changeset
|
108 #include <features.h> |
727e17a1e8b3
strtod: Assume strtod() works when cross-compiling to new-enough glibc.
Ben Pfaff <blp@cs.stanford.edu>
parents:
13426
diff
changeset
|
109 #ifdef __GNU_LIBRARY__ |
13885 | 110 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)) \ |
111 && !defined __UCLIBC__ | |
13427
727e17a1e8b3
strtod: Assume strtod() works when cross-compiling to new-enough glibc.
Ben Pfaff <blp@cs.stanford.edu>
parents:
13426
diff
changeset
|
112 Lucky user |
727e17a1e8b3
strtod: Assume strtod() works when cross-compiling to new-enough glibc.
Ben Pfaff <blp@cs.stanford.edu>
parents:
13426
diff
changeset
|
113 #endif |
727e17a1e8b3
strtod: Assume strtod() works when cross-compiling to new-enough glibc.
Ben Pfaff <blp@cs.stanford.edu>
parents:
13426
diff
changeset
|
114 #endif |
727e17a1e8b3
strtod: Assume strtod() works when cross-compiling to new-enough glibc.
Ben Pfaff <blp@cs.stanford.edu>
parents:
13426
diff
changeset
|
115 ], |
16810
ca49e9a6643d
Say "guessing yes" or "guessing no" when cross-compiling.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
116 [gl_cv_func_strtod_works="guessing yes"], |
18993
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
117 [case "$host_os" in |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
118 # Guess yes on native Windows. |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
119 mingw*) gl_cv_func_strtod_works="guessing yes" ;; |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
120 *) gl_cv_func_strtod_works="guessing no" ;; |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
121 esac |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
122 ]) |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
123 ]) |
a75cfc731331
Improve cross-compilation guesses for native Windows.
Bruno Haible <bruno@clisp.org>
parents:
18626
diff
changeset
|
124 ]) |
16810
ca49e9a6643d
Say "guessing yes" or "guessing no" when cross-compiling.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
125 case "$gl_cv_func_strtod_works" in |
ca49e9a6643d
Say "guessing yes" or "guessing no" when cross-compiling.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
126 *yes) ;; |
ca49e9a6643d
Say "guessing yes" or "guessing no" when cross-compiling.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
127 *) |
ca49e9a6643d
Say "guessing yes" or "guessing no" when cross-compiling.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
128 REPLACE_STRTOD=1 |
ca49e9a6643d
Say "guessing yes" or "guessing no" when cross-compiling.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
129 ;; |
ca49e9a6643d
Say "guessing yes" or "guessing no" when cross-compiling.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
130 esac |
4107
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
131 fi |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
132 ]) |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
133 |
7c1a6b73f48e
An autoconf macro for its associated module.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
134 # Prerequisites of lib/strtod.c. |
13456
fd291325b6d5
strtod: make it more-accurate typically, and don't require libm
Paul R. Eggert <eggert@cs.ucla.edu>
parents:
13427
diff
changeset
|
135 AC_DEFUN([gl_PREREQ_STRTOD], [ |
13462
88292c519d86
Unify tests that set gl_cv_func_ldexp_no_libm.
Bruno Haible <bruno@clisp.org>
parents:
13456
diff
changeset
|
136 AC_REQUIRE([gl_CHECK_LDEXP_NO_LIBM]) |
13456
fd291325b6d5
strtod: make it more-accurate typically, and don't require libm
Paul R. Eggert <eggert@cs.ucla.edu>
parents:
13427
diff
changeset
|
137 if test $gl_cv_func_ldexp_no_libm = yes; then |
fd291325b6d5
strtod: make it more-accurate typically, and don't require libm
Paul R. Eggert <eggert@cs.ucla.edu>
parents:
13427
diff
changeset
|
138 AC_DEFINE([HAVE_LDEXP_IN_LIBC], [1], |
fd291325b6d5
strtod: make it more-accurate typically, and don't require libm
Paul R. Eggert <eggert@cs.ucla.edu>
parents:
13427
diff
changeset
|
139 [Define if the ldexp function is available in libc.]) |
fd291325b6d5
strtod: make it more-accurate typically, and don't require libm
Paul R. Eggert <eggert@cs.ucla.edu>
parents:
13427
diff
changeset
|
140 fi |
40172
31ab89a208b9
strtod, strtold: Use the locale's decimal point.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
141 AC_CHECK_FUNCS([nl_langinfo]) |
13456
fd291325b6d5
strtod: make it more-accurate typically, and don't require libm
Paul R. Eggert <eggert@cs.ucla.edu>
parents:
13427
diff
changeset
|
142 ]) |