diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-02-19 14:20:04 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-02-19 14:20:33 -0800 |
commit | 8824525b61cd675b5344d4a30538edda2ca90108 (patch) | |
tree | a758d7f4dc59a0b139ad2d172b30d363b79051d8 /lib/strtod.c | |
parent | 62bb7a8bf95807d6339e1e17fc0d21c319b280a2 (diff) | |
download | gnulib-8824525b61cd675b5344d4a30538edda2ca90108.tar.gz |
strtod: support coreutils better
* lib/strtod.c (underlying_strtod): Just invoke the underlying strtod.
HAVE_RAW_DECL_STRTOD might not be correct in coreutils, which
disables the raw decl checks. This assumes there is an underlying
strtod, but that's a safe assumption these days.
Diffstat (limited to 'lib/strtod.c')
-rw-r--r-- | lib/strtod.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/strtod.c b/lib/strtod.c index 5c43b4f564..cf59cd5b83 100644 --- a/lib/strtod.c +++ b/lib/strtod.c @@ -344,24 +344,11 @@ strtod (const char *nptr, char **endptr) return negative ? -num : num; } -/* The "underlying" strtod implementation. This must be defined +/* The underlying strtod implementation. This must be defined after strtod because it #undefs strtod. */ static double underlying_strtod (const char *nptr, char **endptr) { - if (HAVE_RAW_DECL_STRTOD) - { - /* Prefer the native strtod if available. Usually it should - work and it should give more-accurate results than our - approximation. */ - #undef strtod - return strtod (nptr, endptr); - } - else - { - /* Approximate strtod well enough for this module. There's no - need to handle anything but finite unsigned decimal - numbers with nonnull ENDPTR. */ - return parse_number (nptr, 10, 10, 1, 'e', endptr); - } +#undef strtod + return strtod (nptr, endptr); } |