1 # c-strtod.m4 serial 18
3 # Copyright (C) 2004-2006, 2009-2020 Free Software Foundation, Inc.
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
8 # Written by Paul Eggert.
10 dnl Prerequisites of lib/c-strtod.c.
11 AC_DEFUN([gl_C_STRTOD],
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
14 AC_REQUIRE([gt_FUNC_USELOCALE])
16 AC_CHECK_HEADERS_ONCE([xlocale.h])
17 dnl We can't use AC_CHECK_FUNC here, because strtod_l() is defined as a
18 dnl static inline function when compiling for Android 7.1 or older.
19 AC_CACHE_CHECK([for strtod_l], [gl_cv_func_strtod_l],
30 return strtod_l("0",&end,loc) < 0.0;
33 [gl_cv_func_strtod_l=yes],
34 [gl_cv_func_strtod_l=no])
36 if test $gl_cv_func_strtod_l = yes; then
41 AC_DEFINE_UNQUOTED([HAVE_STRTOD_L], [$HAVE_STRTOD_L],
42 [Define to 1 if the system has the 'strtod_l' function.])
45 dnl Prerequisites of lib/c-strtold.c.
46 AC_DEFUN([gl_C_STRTOLD],
48 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
49 AC_REQUIRE([gt_FUNC_USELOCALE])
50 AC_CHECK_FUNCS([strtold_l])