# HG changeset patch # User Paul Eggert # Date 1549141315 28800 # Node ID dcd889592b62637829d6c51c2a70d1fa90a3cff3 # Parent 8d12166131359f3dc0fae1c7c06a027000f148be dtoastr,ftoastr,ldtoastr: port to c-strtod changes Decouple these modules from c-strtod. Nowadays it’s reasonable to assume the C99 signatures for strtod and strtold. Programs that require stricter adherence to C99 should also use the strtod and strtold modules as needed, and we no longer need the HAVE_C99_STRTOLD macro. * NEWS: Mention this. * lib/ftoastr.c (STRTOF) [LENGTH == 3]: Assume strtold. * m4/c-strtod.m4 (gl_C_STRTOLD): Do not define HAVE_C99_STRTOLD. * modules/dtoastr, modules/ftoastr, modules/ldtoastr: (Files): Remove m4/c-strtod.m4. (configure.ac): Do not require gl_C99_STRTOLD, which no longer exists. diff -r 8d1216613135 -r dcd889592b62 ChangeLog --- a/ChangeLog Sat Feb 02 08:04:06 2019 -0800 +++ b/ChangeLog Sat Feb 02 13:01:55 2019 -0800 @@ -1,3 +1,19 @@ +2019-02-02 Paul Eggert + + dtoastr,ftoastr,ldtoastr: port to c-strtod changes + Decouple these modules from c-strtod. Nowadays it’s reasonable to + assume the C99 signatures for strtod and strtold. Programs that + require stricter adherence to C99 should also use the strtod and + strtold modules as needed, and we no longer need the + HAVE_C99_STRTOLD macro. + * NEWS: Mention this. + * lib/ftoastr.c (STRTOF) [LENGTH == 3]: Assume strtold. + * m4/c-strtod.m4 (gl_C_STRTOLD): Do not define HAVE_C99_STRTOLD. + * modules/dtoastr, modules/ftoastr, modules/ldtoastr: + (Files): Remove m4/c-strtod.m4. + (configure.ac): Do not require gl_C99_STRTOLD, which no longer + exists. + 2019-02-02 Bruno Haible fma: Improve code style. diff -r 8d1216613135 -r dcd889592b62 NEWS --- a/NEWS Sat Feb 02 08:04:06 2019 -0800 +++ b/NEWS Sat Feb 02 13:01:55 2019 -0800 @@ -48,6 +48,10 @@ Date Modules Changes +2019-02-02 c-strtod This and related modules no longer define + the HAVE_C99_STRTOLD macro. Programs requiring + standard strtold should use the strtold module. + 2019-01-21 diacrit This module is deprecated. Please use the module uninorm/canonical-decomposition instead. diff -r 8d1216613135 -r dcd889592b62 lib/ftoastr.c --- a/lib/ftoastr.c Sat Feb 02 08:04:06 2019 -0800 +++ b/lib/ftoastr.c Sat Feb 02 13:01:55 2019 -0800 @@ -40,9 +40,7 @@ # define FLOAT_PREC_BOUND _GL_LDBL_PREC_BOUND # define FTOASTR ldtoastr # define PROMOTED_FLOAT long double -# if HAVE_C99_STRTOLD -# define STRTOF strtold -# endif +# define STRTOF strtold #elif LENGTH == 2 # define FLOAT double # define FLOAT_DIG DBL_DIG @@ -63,7 +61,7 @@ # endif #endif -/* On pre-C99 hosts, approximate strtof and strtold with strtod. This +/* On pre-C99 hosts, approximate strtof with strtod. This may generate one or two extra digits, but that's better than not working at all. */ #ifndef STRTOF diff -r 8d1216613135 -r dcd889592b62 m4/c-strtod.m4 --- a/m4/c-strtod.m4 Sat Feb 02 08:04:06 2019 -0800 +++ b/m4/c-strtod.m4 Sat Feb 02 13:01:55 2019 -0800 @@ -1,4 +1,4 @@ -# c-strtod.m4 serial 17 +# c-strtod.m4 serial 18 # Copyright (C) 2004-2006, 2009-2019 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -47,7 +47,5 @@ [ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gt_FUNC_USELOCALE]) - AC_DEFINE([HAVE_C99_STRTOLD], [1], - [Define to 1 because the gnulib 'strtold' module provides a C99-conforming strtold function.]) AC_CHECK_FUNCS([strtold_l]) ]) diff -r 8d1216613135 -r dcd889592b62 modules/dtoastr --- a/modules/dtoastr Sat Feb 02 08:04:06 2019 -0800 +++ b/modules/dtoastr Sat Feb 02 13:01:55 2019 -0800 @@ -5,14 +5,12 @@ lib/ftoastr.h lib/ftoastr.c lib/dtoastr.c -m4/c-strtod.m4 Depends-on: extensions intprops configure.ac: -AC_REQUIRE([gl_C99_STRTOLD]) Makefile.am: lib_SOURCES += dtoastr.c diff -r 8d1216613135 -r dcd889592b62 modules/ftoastr --- a/modules/ftoastr Sat Feb 02 08:04:06 2019 -0800 +++ b/modules/ftoastr Sat Feb 02 13:01:55 2019 -0800 @@ -4,7 +4,6 @@ Files: lib/ftoastr.h lib/ftoastr.c -m4/c-strtod.m4 Depends-on: extensions @@ -12,7 +11,6 @@ configure.ac: AC_CHECK_FUNCS_ONCE([strtof]) -AC_REQUIRE([gl_C99_STRTOLD]) Makefile.am: lib_SOURCES += ftoastr.c diff -r 8d1216613135 -r dcd889592b62 modules/ldtoastr --- a/modules/ldtoastr Sat Feb 02 08:04:06 2019 -0800 +++ b/modules/ldtoastr Sat Feb 02 13:01:55 2019 -0800 @@ -5,14 +5,12 @@ lib/ftoastr.h lib/ftoastr.c lib/ldtoastr.c -m4/c-strtod.m4 Depends-on: extensions intprops configure.ac: -AC_REQUIRE([gl_C99_STRTOLD]) Makefile.am: lib_SOURCES += ldtoastr.c