summaryrefslogtreecommitdiffstats
path: root/newlib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/include/stdlib.h4
-rw-r--r--newlib/libc/stdlib/strtold.c10
2 files changed, 10 insertions, 4 deletions
diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h
index ef218663b..905cf5d59 100644
--- a/newlib/libc/include/stdlib.h
+++ b/newlib/libc/include/stdlib.h
@@ -231,11 +231,11 @@ int _EXFUN(_system_r,(struct _reent *, const char *));
_VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *));
/* On platforms where long double equals double. */
-#ifdef _LDBL_EQ_DBL
+#ifdef _HAVE_LONG_DOUBLE
#if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) || (__cplusplus >= 201103L)
extern long double strtold (const char *__restrict, char **__restrict);
#endif
-#endif /* _LDBL_EQ_DBL */
+#endif /* _HAVE_LONG_DOUBLE */
_END_STD_C
diff --git a/newlib/libc/stdlib/strtold.c b/newlib/libc/stdlib/strtold.c
index 390ec735b..a620251ee 100644
--- a/newlib/libc/stdlib/strtold.c
+++ b/newlib/libc/stdlib/strtold.c
@@ -31,12 +31,18 @@ POSSIBILITY OF SUCH DAMAGE.
#include <stdlib.h>
#include "local.h"
+#ifdef _HAVE_LONG_DOUBLE
+extern long double _strtold (const char *, char **);
+
/* On platforms where long double is as wide as double. */
-#ifdef _LDBL_EQ_DBL
long double
strtold (const char *__restrict s00, char **__restrict se)
{
+#ifdef _LDBL_EQ_DBL
return strtod(s00, se);
+#else
+ return _strtold (s00, se);
+#endif
}
-#endif /* _LDBL_EQ_DBL */
+#endif /* _HAVE_LONG_DOUBLE */