diff options
| author | Paul Eggert | 2019-02-02 13:13:45 -0800 |
|---|---|---|
| committer | Paul Eggert | 2019-02-02 13:15:10 -0800 |
| commit | adc31c6bdcdb52c2bc0240982d3e8ce870af1fab (patch) | |
| tree | 7019058dda25743b71ebc584351f6fd0e89bca0e | |
| parent | 6f52478e0c42f02cba940c21b18242f05e1ea2a1 (diff) | |
| download | emacs-adc31c6bdcdb52c2bc0240982d3e8ce870af1fab.tar.gz emacs-adc31c6bdcdb52c2bc0240982d3e8ce870af1fab.zip | |
Update from Gnulib
This incorporates:
2019-02-02 dtoastr, ftoastr, ldtoastr: port to c-strtod changes
2019-02-01 c-strtod, c-strtold: use the bug fixes
2019-01-30 strtold: New module
* doc/misc/texinfo.tex, lib/ftoastr.c, lib/regexec.c, lib/stdlib.in.h:
* m4/stdlib_h.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* m4/c-strtod.m4: Remove.
| -rw-r--r-- | admin/CPP-DEFINES | 1 | ||||
| -rw-r--r-- | doc/misc/texinfo.tex | 15 | ||||
| -rw-r--r-- | lib/ftoastr.c | 6 | ||||
| -rw-r--r-- | lib/gnulib.mk.in | 8 | ||||
| -rw-r--r-- | lib/regexec.c | 6 | ||||
| -rw-r--r-- | lib/stdlib.in.h | 27 | ||||
| -rw-r--r-- | m4/c-strtod.m4 | 76 | ||||
| -rw-r--r-- | m4/gnulib-comp.m4 | 2 | ||||
| -rw-r--r-- | m4/stdlib_h.m4 | 7 |
9 files changed, 54 insertions, 94 deletions
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index 0e75b4d7dde..ea99d50094f 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES | |||
| @@ -104,7 +104,6 @@ HAVE_ALLOCA_H | |||
| 104 | HAVE_ALSA | 104 | HAVE_ALSA |
| 105 | HAVE_BDFFONT | 105 | HAVE_BDFFONT |
| 106 | HAVE_BOXES | 106 | HAVE_BOXES |
| 107 | HAVE_C99_STRTOLD | ||
| 108 | HAVE_CFMAKERAW | 107 | HAVE_CFMAKERAW |
| 109 | HAVE_CFSETSPEED | 108 | HAVE_CFSETSPEED |
| 110 | HAVE_CLOCK_GETTIME | 109 | HAVE_CLOCK_GETTIME |
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index 48d532bc626..71667f03ab9 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex | |||
| @@ -3,10 +3,10 @@ | |||
| 3 | % Load plain if necessary, i.e., if running under initex. | 3 | % Load plain if necessary, i.e., if running under initex. |
| 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
| 5 | % | 5 | % |
| 6 | \def\texinfoversion{2019-01-03-15} | 6 | \def\texinfoversion{2019-02-01.12} |
| 7 | 7 | ||
| 8 | % | 8 | % |
| 9 | % Copyright 1985, 1986, 1988, 1990-2018 Free Software Foundation, Inc. | 9 | % Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc. |
| 10 | % | 10 | % |
| 11 | % This texinfo.tex file is free software: you can redistribute it and/or | 11 | % This texinfo.tex file is free software: you can redistribute it and/or |
| 12 | % modify it under the terms of the GNU General Public License as | 12 | % modify it under the terms of the GNU General Public License as |
| @@ -7515,7 +7515,7 @@ end | |||
| 7515 | \nonfillstart | 7515 | \nonfillstart |
| 7516 | \tt % easiest (and conventionally used) font for verbatim | 7516 | \tt % easiest (and conventionally used) font for verbatim |
| 7517 | % The \leavevmode here is for blank lines. Otherwise, we would | 7517 | % The \leavevmode here is for blank lines. Otherwise, we would |
| 7518 | % never \starttabox and the \egroup would end verbatim mode. | 7518 | % never \starttabbox and the \egroup would end verbatim mode. |
| 7519 | \def\par{\leavevmode\egroup\box\verbbox\endgraf}% | 7519 | \def\par{\leavevmode\egroup\box\verbbox\endgraf}% |
| 7520 | \tabexpand | 7520 | \tabexpand |
| 7521 | \setupmarkupstyle{verbatim}% | 7521 | \setupmarkupstyle{verbatim}% |
| @@ -7578,9 +7578,12 @@ end | |||
| 7578 | {% | 7578 | {% |
| 7579 | \makevalueexpandable | 7579 | \makevalueexpandable |
| 7580 | \setupverbatim | 7580 | \setupverbatim |
| 7581 | \indexnofonts % Allow `@@' and other weird things in file names. | 7581 | {% |
| 7582 | \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% | 7582 | \indexnofonts % Allow `@@' and other weird things in file names. |
| 7583 | \input #1 | 7583 | \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% |
| 7584 | \edef\tmp{\noexpand\input #1 } | ||
| 7585 | \expandafter | ||
| 7586 | }\tmp | ||
| 7584 | \afterenvbreak | 7587 | \afterenvbreak |
| 7585 | }% | 7588 | }% |
| 7586 | } | 7589 | } |
diff --git a/lib/ftoastr.c b/lib/ftoastr.c index 6c0ce261dca..55f1e02e80f 100644 --- a/lib/ftoastr.c +++ b/lib/ftoastr.c | |||
| @@ -40,9 +40,7 @@ | |||
| 40 | # define FLOAT_PREC_BOUND _GL_LDBL_PREC_BOUND | 40 | # define FLOAT_PREC_BOUND _GL_LDBL_PREC_BOUND |
| 41 | # define FTOASTR ldtoastr | 41 | # define FTOASTR ldtoastr |
| 42 | # define PROMOTED_FLOAT long double | 42 | # define PROMOTED_FLOAT long double |
| 43 | # if HAVE_C99_STRTOLD | 43 | # define STRTOF strtold |
| 44 | # define STRTOF strtold | ||
| 45 | # endif | ||
| 46 | #elif LENGTH == 2 | 44 | #elif LENGTH == 2 |
| 47 | # define FLOAT double | 45 | # define FLOAT double |
| 48 | # define FLOAT_DIG DBL_DIG | 46 | # define FLOAT_DIG DBL_DIG |
| @@ -63,7 +61,7 @@ | |||
| 63 | # endif | 61 | # endif |
| 64 | #endif | 62 | #endif |
| 65 | 63 | ||
| 66 | /* On pre-C99 hosts, approximate strtof and strtold with strtod. This | 64 | /* On pre-C99 hosts, approximate strtof with strtod. This |
| 67 | may generate one or two extra digits, but that's better than not | 65 | may generate one or two extra digits, but that's better than not |
| 68 | working at all. */ | 66 | working at all. */ |
| 69 | #ifndef STRTOF | 67 | #ifndef STRTOF |
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in index fdf45d61c4c..d8e51ad403b 100644 --- a/lib/gnulib.mk.in +++ b/lib/gnulib.mk.in | |||
| @@ -176,7 +176,6 @@ BUILD_DETAILS = @BUILD_DETAILS@ | |||
| 176 | BYTESWAP_H = @BYTESWAP_H@ | 176 | BYTESWAP_H = @BYTESWAP_H@ |
| 177 | CAIRO_CFLAGS = @CAIRO_CFLAGS@ | 177 | CAIRO_CFLAGS = @CAIRO_CFLAGS@ |
| 178 | CAIRO_LIBS = @CAIRO_LIBS@ | 178 | CAIRO_LIBS = @CAIRO_LIBS@ |
| 179 | CANNOT_DUMP = @CANNOT_DUMP@ | ||
| 180 | CC = @CC@ | 179 | CC = @CC@ |
| 181 | CFLAGS = @CFLAGS@ | 180 | CFLAGS = @CFLAGS@ |
| 182 | CFLAGS_SOUND = @CFLAGS_SOUND@ | 181 | CFLAGS_SOUND = @CFLAGS_SOUND@ |
| @@ -432,6 +431,7 @@ GNULIB_STRSTR = @GNULIB_STRSTR@ | |||
| 432 | GNULIB_STRTOD = @GNULIB_STRTOD@ | 431 | GNULIB_STRTOD = @GNULIB_STRTOD@ |
| 433 | GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ | 432 | GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@ |
| 434 | GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ | 433 | GNULIB_STRTOK_R = @GNULIB_STRTOK_R@ |
| 434 | GNULIB_STRTOLD = @GNULIB_STRTOLD@ | ||
| 435 | GNULIB_STRTOLL = @GNULIB_STRTOLL@ | 435 | GNULIB_STRTOLL = @GNULIB_STRTOLL@ |
| 436 | GNULIB_STRTOULL = @GNULIB_STRTOULL@ | 436 | GNULIB_STRTOULL = @GNULIB_STRTOULL@ |
| 437 | GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ | 437 | GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@ |
| @@ -634,6 +634,7 @@ HAVE_STRPBRK = @HAVE_STRPBRK@ | |||
| 634 | HAVE_STRPTIME = @HAVE_STRPTIME@ | 634 | HAVE_STRPTIME = @HAVE_STRPTIME@ |
| 635 | HAVE_STRSEP = @HAVE_STRSEP@ | 635 | HAVE_STRSEP = @HAVE_STRSEP@ |
| 636 | HAVE_STRTOD = @HAVE_STRTOD@ | 636 | HAVE_STRTOD = @HAVE_STRTOD@ |
| 637 | HAVE_STRTOLD = @HAVE_STRTOLD@ | ||
| 637 | HAVE_STRTOLL = @HAVE_STRTOLL@ | 638 | HAVE_STRTOLL = @HAVE_STRTOLL@ |
| 638 | HAVE_STRTOULL = @HAVE_STRTOULL@ | 639 | HAVE_STRTOULL = @HAVE_STRTOULL@ |
| 639 | HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ | 640 | HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@ |
| @@ -934,6 +935,7 @@ REPLACE_STRSTR = @REPLACE_STRSTR@ | |||
| 934 | REPLACE_STRTOD = @REPLACE_STRTOD@ | 935 | REPLACE_STRTOD = @REPLACE_STRTOD@ |
| 935 | REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ | 936 | REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@ |
| 936 | REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ | 937 | REPLACE_STRTOK_R = @REPLACE_STRTOK_R@ |
| 938 | REPLACE_STRTOLD = @REPLACE_STRTOLD@ | ||
| 937 | REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ | 939 | REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@ |
| 938 | REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ | 940 | REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@ |
| 939 | REPLACE_SYMLINK = @REPLACE_SYMLINK@ | 941 | REPLACE_SYMLINK = @REPLACE_SYMLINK@ |
| @@ -959,6 +961,7 @@ REPLACE_WRITE = @REPLACE_WRITE@ | |||
| 959 | RSVG_CFLAGS = @RSVG_CFLAGS@ | 961 | RSVG_CFLAGS = @RSVG_CFLAGS@ |
| 960 | RSVG_LIBS = @RSVG_LIBS@ | 962 | RSVG_LIBS = @RSVG_LIBS@ |
| 961 | SEPCHAR = @SEPCHAR@ | 963 | SEPCHAR = @SEPCHAR@ |
| 964 | SETFATTR = @SETFATTR@ | ||
| 962 | SETTINGS_CFLAGS = @SETTINGS_CFLAGS@ | 965 | SETTINGS_CFLAGS = @SETTINGS_CFLAGS@ |
| 963 | SETTINGS_LIBS = @SETTINGS_LIBS@ | 966 | SETTINGS_LIBS = @SETTINGS_LIBS@ |
| 964 | SHELL = @SHELL@ | 967 | SHELL = @SHELL@ |
| @@ -2546,6 +2549,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ | |||
| 2546 | -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \ | 2549 | -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \ |
| 2547 | -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ | 2550 | -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \ |
| 2548 | -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ | 2551 | -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \ |
| 2552 | -e 's/@''GNULIB_STRTOLD''@/$(GNULIB_STRTOLD)/g' \ | ||
| 2549 | -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ | 2553 | -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \ |
| 2550 | -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ | 2554 | -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \ |
| 2551 | -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ | 2555 | -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \ |
| @@ -2582,6 +2586,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ | |||
| 2582 | -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \ | 2586 | -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \ |
| 2583 | -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \ | 2587 | -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \ |
| 2584 | -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ | 2588 | -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \ |
| 2589 | -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \ | ||
| 2585 | -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ | 2590 | -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \ |
| 2586 | -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ | 2591 | -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \ |
| 2587 | -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ | 2592 | -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \ |
| @@ -2605,6 +2610,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ | |||
| 2605 | -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ | 2610 | -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ |
| 2606 | -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \ | 2611 | -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \ |
| 2607 | -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ | 2612 | -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \ |
| 2613 | -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \ | ||
| 2608 | -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ | 2614 | -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \ |
| 2609 | -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ | 2615 | -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \ |
| 2610 | -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ | 2616 | -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ |
diff --git a/lib/regexec.c b/lib/regexec.c index 2f7cb5dcb1f..7fcd1a509ae 100644 --- a/lib/regexec.c +++ b/lib/regexec.c | |||
| @@ -1293,8 +1293,10 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs, | |||
| 1293 | else if (naccepted) | 1293 | else if (naccepted) |
| 1294 | { | 1294 | { |
| 1295 | char *buf = (char *) re_string_get_buffer (&mctx->input); | 1295 | char *buf = (char *) re_string_get_buffer (&mctx->input); |
| 1296 | if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, | 1296 | if (mctx->input.valid_len - *pidx < naccepted |
| 1297 | naccepted) != 0) | 1297 | || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, |
| 1298 | naccepted) | ||
| 1299 | != 0)) | ||
| 1298 | return -1; | 1300 | return -1; |
| 1299 | } | 1301 | } |
| 1300 | } | 1302 | } |
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index be8ab3b86c2..f829525c104 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h | |||
| @@ -929,6 +929,7 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - " | |||
| 929 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | 929 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) |
| 930 | # define strtod rpl_strtod | 930 | # define strtod rpl_strtod |
| 931 | # endif | 931 | # endif |
| 932 | # define GNULIB_defined_strtod_function 1 | ||
| 932 | _GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp) | 933 | _GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp) |
| 933 | _GL_ARG_NONNULL ((1))); | 934 | _GL_ARG_NONNULL ((1))); |
| 934 | _GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp)); | 935 | _GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp)); |
| @@ -948,6 +949,32 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - " | |||
| 948 | # endif | 949 | # endif |
| 949 | #endif | 950 | #endif |
| 950 | 951 | ||
| 952 | #if @GNULIB_STRTOLD@ | ||
| 953 | /* Parse a 'long double' from STRING, updating ENDP if appropriate. */ | ||
| 954 | # if @REPLACE_STRTOLD@ | ||
| 955 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 956 | # define strtold rpl_strtold | ||
| 957 | # endif | ||
| 958 | # define GNULIB_defined_strtold_function 1 | ||
| 959 | _GL_FUNCDECL_RPL (strtold, long double, (const char *str, char **endp) | ||
| 960 | _GL_ARG_NONNULL ((1))); | ||
| 961 | _GL_CXXALIAS_RPL (strtold, long double, (const char *str, char **endp)); | ||
| 962 | # else | ||
| 963 | # if !@HAVE_STRTOLD@ | ||
| 964 | _GL_FUNCDECL_SYS (strtold, long double, (const char *str, char **endp) | ||
| 965 | _GL_ARG_NONNULL ((1))); | ||
| 966 | # endif | ||
| 967 | _GL_CXXALIAS_SYS (strtold, long double, (const char *str, char **endp)); | ||
| 968 | # endif | ||
| 969 | _GL_CXXALIASWARN (strtold); | ||
| 970 | #elif defined GNULIB_POSIXCHECK | ||
| 971 | # undef strtold | ||
| 972 | # if HAVE_RAW_DECL_STRTOLD | ||
| 973 | _GL_WARN_ON_USE (strtold, "strtold is unportable - " | ||
| 974 | "use gnulib module strtold for portability"); | ||
| 975 | # endif | ||
| 976 | #endif | ||
| 977 | |||
| 951 | #if @GNULIB_STRTOLL@ | 978 | #if @GNULIB_STRTOLL@ |
| 952 | /* Parse a signed integer whose textual representation starts at STRING. | 979 | /* Parse a signed integer whose textual representation starts at STRING. |
| 953 | The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, | 980 | The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0, |
diff --git a/m4/c-strtod.m4 b/m4/c-strtod.m4 deleted file mode 100644 index 1694a2396c5..00000000000 --- a/m4/c-strtod.m4 +++ /dev/null | |||
| @@ -1,76 +0,0 @@ | |||
| 1 | # c-strtod.m4 serial 16 | ||
| 2 | |||
| 3 | # Copyright (C) 2004-2006, 2009-2019 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. | ||
| 7 | |||
| 8 | # Written by Paul Eggert. | ||
| 9 | |||
| 10 | AC_DEFUN([gl_C99_STRTOLD], | ||
| 11 | [ | ||
| 12 | AC_CACHE_CHECK([whether strtold conforms to C99], | ||
| 13 | [gl_cv_func_c99_strtold], | ||
| 14 | [AC_LINK_IFELSE( | ||
| 15 | [AC_LANG_PROGRAM( | ||
| 16 | [[/* On HP-UX before 11.23, strtold returns a struct instead of | ||
| 17 | long double. Reject implementations like that, by requiring | ||
| 18 | compatibility with the C99 prototype. */ | ||
| 19 | #include <stdlib.h> | ||
| 20 | static long double (*p) (char const *, char **) = strtold; | ||
| 21 | static long double | ||
| 22 | test (char const *nptr, char **endptr) | ||
| 23 | { | ||
| 24 | long double r; | ||
| 25 | r = strtold (nptr, endptr); | ||
| 26 | return r; | ||
| 27 | }]], | ||
| 28 | [[return test ("1.0", NULL) != 1 || p ("1.0", NULL) != 1;]])], | ||
| 29 | [gl_cv_func_c99_strtold=yes], | ||
| 30 | [gl_cv_func_c99_strtold=no])]) | ||
| 31 | if test $gl_cv_func_c99_strtold = yes; then | ||
| 32 | AC_DEFINE([HAVE_C99_STRTOLD], [1], [Define to 1 if strtold conforms to C99.]) | ||
| 33 | fi | ||
| 34 | ]) | ||
| 35 | |||
| 36 | dnl Prerequisites of lib/c-strtod.c. | ||
| 37 | AC_DEFUN([gl_C_STRTOD], | ||
| 38 | [ | ||
| 39 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | ||
| 40 | |||
| 41 | AC_CHECK_HEADERS_ONCE([xlocale.h]) | ||
| 42 | dnl We can't use AC_CHECK_FUNC here, because strtod_l() is defined as a | ||
| 43 | dnl static inline function when compiling for Android 7.1 or older. | ||
| 44 | AC_CACHE_CHECK([for strtod_l], [gl_cv_func_strtod_l], | ||
| 45 | [AC_LINK_IFELSE( | ||
| 46 | [AC_LANG_PROGRAM( | ||
| 47 | [[#include <stdlib.h> | ||
| 48 | #include <locale.h> | ||
| 49 | #if HAVE_XLOCALE_H | ||
| 50 | # include <xlocale.h> | ||
| 51 | #endif | ||
| 52 | locale_t loc; | ||
| 53 | ]], | ||
| 54 | [[char *end; | ||
| 55 | return strtod_l("0",&end,loc) < 0.0; | ||
| 56 | ]]) | ||
| 57 | ], | ||
| 58 | [gl_cv_func_strtod_l=yes], | ||
| 59 | [gl_cv_func_strtod_l=no]) | ||
| 60 | ]) | ||
| 61 | if test $gl_cv_func_strtod_l = yes; then | ||
| 62 | HAVE_STRTOD_L=1 | ||
| 63 | else | ||
| 64 | HAVE_STRTOD_L=0 | ||
| 65 | fi | ||
| 66 | AC_DEFINE_UNQUOTED([HAVE_STRTOD_L], [$HAVE_STRTOD_L], | ||
| 67 | [Define to 1 if the system has the 'strtod_l' function.]) | ||
| 68 | ]) | ||
| 69 | |||
| 70 | dnl Prerequisites of lib/c-strtold.c. | ||
| 71 | AC_DEFUN([gl_C_STRTOLD], | ||
| 72 | [ | ||
| 73 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | ||
| 74 | AC_REQUIRE([gl_C99_STRTOLD]) | ||
| 75 | AC_CHECK_FUNCS([strtold_l]) | ||
| 76 | ]) | ||
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index a432cc8e541..f25a0e40816 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 | |||
| @@ -209,7 +209,6 @@ AC_DEFUN([gl_INIT], | |||
| 209 | gl_SHA512 | 209 | gl_SHA512 |
| 210 | gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE | 210 | gl_CHECK_TYPE_STRUCT_DIRENT_D_TYPE |
| 211 | gl_DIRENT_H | 211 | gl_DIRENT_H |
| 212 | AC_REQUIRE([gl_C99_STRTOLD]) | ||
| 213 | gl_FUNC_DUP2 | 212 | gl_FUNC_DUP2 |
| 214 | if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then | 213 | if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then |
| 215 | AC_LIBOBJ([dup2]) | 214 | AC_LIBOBJ([dup2]) |
| @@ -999,7 +998,6 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 999 | m4/alloca.m4 | 998 | m4/alloca.m4 |
| 1000 | m4/builtin-expect.m4 | 999 | m4/builtin-expect.m4 |
| 1001 | m4/byteswap.m4 | 1000 | m4/byteswap.m4 |
| 1002 | m4/c-strtod.m4 | ||
| 1003 | m4/clock_time.m4 | 1001 | m4/clock_time.m4 |
| 1004 | m4/close-stream.m4 | 1002 | m4/close-stream.m4 |
| 1005 | m4/count-leading-zeros.m4 | 1003 | m4/count-leading-zeros.m4 |
diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index c5db804e4d6..6121602aea3 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | # stdlib_h.m4 serial 47 | 1 | # stdlib_h.m4 serial 48 |
| 2 | dnl Copyright (C) 2007-2019 Free Software Foundation, Inc. | 2 | dnl Copyright (C) 2007-2019 Free Software Foundation, Inc. |
| 3 | dnl This file is free software; the Free Software Foundation | 3 | dnl This file is free software; the Free Software Foundation |
| 4 | dnl gives unlimited permission to copy and/or distribute it, | 4 | dnl gives unlimited permission to copy and/or distribute it, |
| @@ -26,7 +26,7 @@ AC_DEFUN([gl_STDLIB_H], | |||
| 26 | initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps | 26 | initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps |
| 27 | posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray | 27 | posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray |
| 28 | realpath rpmatch secure_getenv setenv setstate setstate_r srandom | 28 | realpath rpmatch secure_getenv setenv setstate setstate_r srandom |
| 29 | srandom_r strtod strtoll strtoull unlockpt unsetenv]) | 29 | srandom_r strtod strtold strtoll strtoull unlockpt unsetenv]) |
| 30 | ]) | 30 | ]) |
| 31 | 31 | ||
| 32 | AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], | 32 | AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], |
| @@ -68,6 +68,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], | |||
| 68 | GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV]) | 68 | GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV]) |
| 69 | GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) | 69 | GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV]) |
| 70 | GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD]) | 70 | GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD]) |
| 71 | GNULIB_STRTOLD=0; AC_SUBST([GNULIB_STRTOLD]) | ||
| 71 | GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL]) | 72 | GNULIB_STRTOLL=0; AC_SUBST([GNULIB_STRTOLL]) |
| 72 | GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL]) | 73 | GNULIB_STRTOULL=0; AC_SUBST([GNULIB_STRTOULL]) |
| 73 | GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX]) | 74 | GNULIB_SYSTEM_POSIX=0; AC_SUBST([GNULIB_SYSTEM_POSIX]) |
| @@ -105,6 +106,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], | |||
| 105 | HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE]) | 106 | HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE]) |
| 106 | HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE]) | 107 | HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE]) |
| 107 | HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) | 108 | HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) |
| 109 | HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD]) | ||
| 108 | HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) | 110 | HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) |
| 109 | HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) | 111 | HAVE_STRTOULL=1; AC_SUBST([HAVE_STRTOULL]) |
| 110 | HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) | 112 | HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA]) |
| @@ -128,6 +130,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], | |||
| 128 | REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) | 130 | REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) |
| 129 | REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE]) | 131 | REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE]) |
| 130 | REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) | 132 | REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) |
| 133 | REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD]) | ||
| 131 | REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV]) | 134 | REPLACE_UNSETENV=0; AC_SUBST([REPLACE_UNSETENV]) |
| 132 | REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB]) | 135 | REPLACE_WCTOMB=0; AC_SUBST([REPLACE_WCTOMB]) |
| 133 | ]) | 136 | ]) |