summaryrefslogtreecommitdiff
path: root/lib/ftoastr.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-06-15 11:50:18 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-06-15 11:50:18 -0700
commit8c9b210626493dd93f236d7fb312c4f6dba62892 (patch)
treef7f0c345546eabd662d3ae855e1fbfc9a62bd43a /lib/ftoastr.c
parenteeafcea7ee4c253678e842342e0ea8ea0d442f30 (diff)
downloademacs-8c9b210626493dd93f236d7fb312c4f6dba62892.tar.gz
* lib/ftoastr.c, lib/stdio.in.h, lib/verify.h: Merge from gnulib.
Diffstat (limited to 'lib/ftoastr.c')
-rw-r--r--lib/ftoastr.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/ftoastr.c b/lib/ftoastr.c
index ff3d87ce22d..7c99ef00f38 100644
--- a/lib/ftoastr.c
+++ b/lib/ftoastr.c
@@ -40,14 +40,15 @@
# define FLOAT_MIN LDBL_MIN
# define FLOAT_PREC_BOUND _GL_LDBL_PREC_BOUND
# define FTOASTR ldtoastr
-# define STRTOF strtold
+# if HAVE_C99_STRTOLD
+# define STRTOF strtold
+# endif
#elif LENGTH == 2
# define FLOAT double
# define FLOAT_DIG DBL_DIG
# define FLOAT_MIN DBL_MIN
# define FLOAT_PREC_BOUND _GL_DBL_PREC_BOUND
# define FTOASTR dtoastr
-# define STRTOF strtod
#else
# define LENGTH 1
# define FLOAT float
@@ -55,14 +56,15 @@
# define FLOAT_MIN FLT_MIN
# define FLOAT_PREC_BOUND _GL_FLT_PREC_BOUND
# define FTOASTR ftoastr
-# define STRTOF strtof
+# if HAVE_STRTOF
+# define STRTOF strtof
+# endif
#endif
/* On pre-C99 hosts, approximate strtof and strtold with strtod. This
may generate one or two extra digits, but that's better than not
- working at all. Assume that strtof works if strtold does. */
-#if LENGTH != 2 && ! HAVE_C99_STRTOLD
-# undef STRTOF
+ working at all. */
+#ifndef STRTOF
# define STRTOF strtod
#endif