2 dnl Copyright (C) 2002, 2003, 2006, 2007, 2008 Free Software
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_FUNC_STRTOD],
10 AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
12 dnl Note: AC_FUNC_STRTOD does AC_LIBOBJ(strtod).
13 if test $ac_cv_func_strtod = no; then
18 AC_CACHE_CHECK([whether strtod obeys C99], [gl_cv_func_strtod_works],
19 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
24 /* Older glibc and Cygwin mis-parse "-0x". */
27 double value = strtod (string, &term);
28 if (1 / value != -HUGE_VAL || term != (string + 2))
32 /* Many platforms do not parse infinities. */
35 double value = strtod (string, &term);
36 if (value != HUGE_VAL || term != (string + 3))
40 [gl_cv_func_strtod_works=yes],
41 [gl_cv_func_strtod_works=no],
42 [gl_cv_func_strtod_works="guessing no"])])
43 if test "$gl_cv_func_strtod_works" != yes; then
46 dnl Use undocumented macro to set POW_LIB correctly.
52 # Prerequisites of lib/strtod.c.
53 # The need for pow() is already handled by AC_FUNC_STRTOD.
54 AC_DEFUN([gl_PREREQ_STRTOD], [:])