annotate m4/c-strtod.m4 @ 40246:c34f677e6117 default tip master

_Noreturn: GCC 4.7 does not support [[noreturn]] in C++11 mode * lib/_Noreturn.h, m4/gnulib-common.m4: Don't use [[noreturn]] before GCC 4.8.
author Akim Demaille <akim.demaille@gmail.com>
date Sun, 17 Mar 2019 19:27:20 +0100
parents dcd889592b62
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
40177
dcd889592b62 dtoastr,ftoastr,ldtoastr: port to c-strtod changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 40173
diff changeset
1 # c-strtod.m4 serial 18
5114
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
2
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19654
diff changeset
3 # Copyright (C) 2004-2006, 2009-2019 Free Software Foundation, Inc.
5611
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5558
diff changeset
4 # 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: 5558
diff changeset
5 # 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: 5558
diff changeset
6 # with or without modifications, as long as this notice is preserved.
5114
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
7
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
8 # Written by Paul Eggert.
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
9
15188
b17e131e479b c-strtod: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents: 14079
diff changeset
10 dnl Prerequisites of lib/c-strtod.c.
5114
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
11 AC_DEFUN([gl_C_STRTOD],
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
12 [
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
40173
b716418da8b9 c-strtod, c-strtold: Use the bug fixes for strtod, strtold.
Bruno Haible <bruno@clisp.org>
parents: 40057
diff changeset
14 AC_REQUIRE([gt_FUNC_USELOCALE])
19654
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
15
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
16 AC_CHECK_HEADERS_ONCE([xlocale.h])
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
17 dnl We can't use AC_CHECK_FUNC here, because strtod_l() is defined as a
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
18 dnl static inline function when compiling for Android 7.1 or older.
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
19 AC_CACHE_CHECK([for strtod_l], [gl_cv_func_strtod_l],
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
20 [AC_LINK_IFELSE(
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
21 [AC_LANG_PROGRAM(
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
22 [[#include <stdlib.h>
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
23 #include <locale.h>
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
24 #if HAVE_XLOCALE_H
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
25 # include <xlocale.h>
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
26 #endif
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
27 locale_t loc;
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
28 ]],
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
29 [[char *end;
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
30 return strtod_l("0",&end,loc) < 0.0;
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
31 ]])
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
32 ],
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
33 [gl_cv_func_strtod_l=yes],
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
34 [gl_cv_func_strtod_l=no])
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
35 ])
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
36 if test $gl_cv_func_strtod_l = yes; then
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
37 HAVE_STRTOD_L=1
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
38 else
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
39 HAVE_STRTOD_L=0
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
40 fi
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
41 AC_DEFINE_UNQUOTED([HAVE_STRTOD_L], [$HAVE_STRTOD_L],
3319693cc605 c-strtod: Fix configure test for Android.
Bruno Haible <bruno@clisp.org>
parents: 19484
diff changeset
42 [Define to 1 if the system has the 'strtod_l' function.])
5114
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
43 ])
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
44
15189
baa289766f6b c-strtold: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents: 15188
diff changeset
45 dnl Prerequisites of lib/c-strtold.c.
5114
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
46 AC_DEFUN([gl_C_STRTOLD],
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
47 [
6912
314715e0260d Merge from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6808
diff changeset
48 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
40173
b716418da8b9 c-strtod, c-strtold: Use the bug fixes for strtod, strtold.
Bruno Haible <bruno@clisp.org>
parents: 40057
diff changeset
49 AC_REQUIRE([gt_FUNC_USELOCALE])
13877
5fb52cb372b0 c-strtold: Avoid link error on AIX 7.
Bruno Haible <bruno@clisp.org>
parents: 12559
diff changeset
50 AC_CHECK_FUNCS([strtold_l])
5114
e0eddd7ceb40 Imported from coreutils.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
51 ])