3 # Copyright (C) 2004 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 # Written by Paul Eggert.
21 AC_DEFUN([gl_C99_STRTOLD],
23 AC_CACHE_CHECK([whether strtold conforms to C99],
24 [gl_cv_func_c99_strtold],
27 [[/* On HP-UX before 11.23, strtold returns a struct instead of
28 long double. Reject implementations like that, by requiring
29 compatibility with the C99 prototype. */
31 static long double (*p) (char const *, char **) = strtold;
33 test (char const *nptr, char **endptr)
36 r = strtold (nptr, endptr);
39 [[return test ("1.0", NULL) != 1 || p ("1.0", NULL) != 1;]])],
40 [gl_cv_func_c99_strtold=yes],
41 [gl_cv_func_c99_strtold=no])])
42 if test $gl_cv_func_c99_strtold = yes; then
43 AC_DEFINE([HAVE_C99_STRTOLD], 1, [Define to 1 if strtold conforms to C99.])
47 AC_DEFUN([gl_C_STRTOD],
49 dnl Prerequisites of lib/c-strtod.c.
50 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
54 AC_DEFUN([gl_C_STRTOLD],
56 dnl Prerequisites of lib/c-strtold.c.
57 AC_REQUIRE([gl_C_STRTOD])
58 AC_REQUIRE([gl_C99_STRTOLD])