summaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/strtod.c40
-rw-r--r--stdlib/strtod_l.c40
2 files changed, 80 insertions, 0 deletions
diff --git a/stdlib/strtod.c b/stdlib/strtod.c
index 2ac1b2e57a..546ab9e3d3 100644
--- a/stdlib/strtod.c
+++ b/stdlib/strtod.c
@@ -17,6 +17,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <bits/floatn.h>
+
+#ifdef FLOAT
+# define BUILD_DOUBLE 0
+#else
+# define BUILD_DOUBLE 1
+#endif
+
+#if BUILD_DOUBLE
+# if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64
+# define strtof64 __hide_strtof64
+# define wcstof64 __hide_wcstof64
+# endif
+# if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X
+# define strtof32x __hide_strtof32x
+# define wcstof32x __hide_wcstof32x
+# endif
+#endif
+
#include <stdlib.h>
#include <wchar.h>
#include <locale/localeinfo.h>
@@ -78,3 +97,24 @@ compat_symbol (libc, __strtod_internal, __strtold_internal, GLIBC_2_0);
# endif
# endif
#endif
+
+#if BUILD_DOUBLE
+# if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64
+# undef strtof64
+# undef wcstof64
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstod, wcstof64)
+# else
+weak_alias (strtod, strtof64)
+# endif
+# endif
+# if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X
+# undef strtof32x
+# undef wcstof32x
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstod, wcstof32x)
+# else
+weak_alias (strtod, strtof32x)
+# endif
+# endif
+#endif
diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
index 9fc9e4c013..30087217f7 100644
--- a/stdlib/strtod_l.c
+++ b/stdlib/strtod_l.c
@@ -17,6 +17,25 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <bits/floatn.h>
+
+#ifdef FLOAT
+# define BUILD_DOUBLE 0
+#else
+# define BUILD_DOUBLE 1
+#endif
+
+#if BUILD_DOUBLE
+# if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64
+# define strtof64_l __hide_strtof64_l
+# define wcstof64_l __hide_wcstof64_l
+# endif
+# if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X
+# define strtof32x_l __hide_strtof32x_l
+# define wcstof32x_l __hide_wcstof32x_l
+# endif
+#endif
+
#include <locale.h>
extern double ____strtod_l_internal (const char *, char **, int, locale_t);
@@ -1784,3 +1803,24 @@ compat_symbol (libc, strtod_l, strtold_l, GLIBC_2_3);
# endif
# endif
#endif
+
+#if BUILD_DOUBLE
+# if __HAVE_FLOAT64 && !__HAVE_DISTINCT_FLOAT64
+# undef strtof64_l
+# undef wcstof64_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstod_l, wcstof64_l)
+# else
+weak_alias (strtod_l, strtof64_l)
+# endif
+# endif
+# if __HAVE_FLOAT32X && !__HAVE_DISTINCT_FLOAT32X
+# undef strtof32x_l
+# undef wcstof32x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstod_l, wcstof32x_l)
+# else
+weak_alias (strtod_l, strtof32x_l)
+# endif
+# endif
+#endif