summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdlib')
-rw-r--r--newlib/libc/stdlib/local.h9
-rw-r--r--newlib/libc/stdlib/strtold.c1
-rw-r--r--newlib/libc/stdlib/wcstold.c1
3 files changed, 11 insertions, 0 deletions
diff --git a/newlib/libc/stdlib/local.h b/newlib/libc/stdlib/local.h
index 37856f8be..347154ac1 100644
--- a/newlib/libc/stdlib/local.h
+++ b/newlib/libc/stdlib/local.h
@@ -63,4 +63,13 @@ int __iso_8859_index (const char *);
wchar_t __cp_conv[12][0x80];
int __cp_index (const char *);
+#include <float.h>
+
+/* Check if long double is as wide as double. */
+#if (!defined(__STRICT_ANSI__) || __STDC_VERSION__ > 199901L || \
+ defined(__cplusplus)) && defined(LDBL_MANT_DIG) && \
+ (DBL_MANT_DIG == LDBL_MANT_DIG && LDBL_MIN_EXP == DBL_MIN_EXP && \
+ LDBL_MAX_EXP == DBL_MAX_EXP)
+ #define _LDBL_EQ_DBL
+#endif
#endif
diff --git a/newlib/libc/stdlib/strtold.c b/newlib/libc/stdlib/strtold.c
index 2abd084a9..94f9613d2 100644
--- a/newlib/libc/stdlib/strtold.c
+++ b/newlib/libc/stdlib/strtold.c
@@ -29,6 +29,7 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
+#include "local.h"
/* On platforms where long double is as wide as double. */
#ifdef _LDBL_EQ_DBL
diff --git a/newlib/libc/stdlib/wcstold.c b/newlib/libc/stdlib/wcstold.c
index 6c8a422bb..8b0ba2440 100644
--- a/newlib/libc/stdlib/wcstold.c
+++ b/newlib/libc/stdlib/wcstold.c
@@ -29,6 +29,7 @@ POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
+#include "local.h"
/* On platforms where long double is as wide as double. */
#ifdef _LDBL_EQ_DBL