]> Savannah Git Hosting - gnulib.git/commitdiff
dtoastr,ftoastr,ldtoastr: port to c-strtod changes
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Feb 2019 21:01:55 +0000 (13:01 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 2 Feb 2019 21:12:48 +0000 (13:12 -0800)
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.

ChangeLog
NEWS
lib/ftoastr.c
m4/c-strtod.m4
modules/dtoastr
modules/ftoastr
modules/ldtoastr

index 8716134a966a61d71b0eaad9e5928c42be36dbf8..91ff7eaed13c716181a45c3f5b0cc53383aa18b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2019-02-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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  <bruno@clisp.org>
 
        fma: Improve code style.
diff --git a/NEWS b/NEWS
index f8150a9eaffe1263c2912fb2936b436324681fd4..481524b9439d311f1dfd56dc4938b61be89b3467 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -48,6 +48,10 @@ User visible incompatible changes
 
 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.
 
index 6c0ce261dcad9753a772dbb57b5cda632b78f640..55f1e02e80f13a0305628ee1b0063c2275ce9cc1 100644 (file)
@@ -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
index 1d4b7f860c929d9a7d4d650e7cba44fce656af60..58e9c40be2e1b39e92b7c4f77cec13c819c5b3f9 100644 (file)
@@ -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_DEFUN([gl_C_STRTOLD],
 [
   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])
 ])
index 72f0da8fcd5a8f80d7789e5f65eb058faab57a1d..e29b37e866efee3d31ceacbf8cb5a85b546bf029 100644 (file)
@@ -5,14 +5,12 @@ Files:
 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
index 2d583d491230cd5bb4d4696a9201f258358bbec2..0088db160e0645d6381d43a2dd754e263a642306 100644 (file)
@@ -4,7 +4,6 @@ Convert float to accurate string.
 Files:
 lib/ftoastr.h
 lib/ftoastr.c
-m4/c-strtod.m4
 
 Depends-on:
 extensions
@@ -12,7 +11,6 @@ intprops
 
 configure.ac:
 AC_CHECK_FUNCS_ONCE([strtof])
-AC_REQUIRE([gl_C99_STRTOLD])
 
 Makefile.am:
 lib_SOURCES += ftoastr.c
index 5695e77ee040b01eac0a8426ac4a0ebfae02c02c..40d69f3d6cf7a73cc3b6b7b8e32102b13b14b35e 100644 (file)
@@ -5,14 +5,12 @@ Files:
 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