]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Support strtof64x, wcstof64x aliases.
authorJoseph Myers <joseph@codesourcery.com>
Fri, 24 Nov 2017 22:51:53 +0000 (22:51 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 24 Nov 2017 22:51:53 +0000 (22:51 +0000)
This patch adds support for defining strtof64x, strtof64x_l, wcstof64
and wcstof64x_l function aliases when _Float64x is supported.

Tested for x86_64, including in conjunction with _Float64x support
patches, and also tested build for other configurations (in
conjunction with _Float64x support patches) with build-many-glibcs.py
to cover the various different files needing updating to define these
aliases.

* stdlib/strtold.c [__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x):
Define and later undefine as macro.  Define as weak alias if
[!USE_WIDE_CHAR].
[__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x): Define and later
undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].
* sysdeps/ieee754/float128/strtof128.c: Include <bits/floatn.h>.
[__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x):
Define and later undefine as macro.  Define as weak alias if
[!USE_WIDE_CHAR].
[__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x):
Define and later undefine as macro.  Define as weak alias if
[USE_WIDE_CHAR].
* sysdeps/ieee754/float128/strtof128_l.c
[__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l):
Define and later undefine as macro.  Define as weak alias if
[!USE_WIDE_CHAR].
[__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l):
Define and later undefine as macro.  Define as weak alias if
[USE_WIDE_CHAR].
* sysdeps/ieee754/ldbl-128/strtold_l.c
[__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later
undefine as macro.  Define as weak alias if [!USE_WIDE_CHAR].
[__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later
undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].
* sysdeps/ieee754/ldbl-64-128/strtold_l.c
[__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later
undefine as macro.  Define as weak alias if [!USE_WIDE_CHAR].
[__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later
undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].
* sysdeps/ieee754/ldbl-96/strtold_l.c
[__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later
undefine as macro.  Define as weak alias if [!USE_WIDE_CHAR].
[__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later
undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].

ChangeLog
stdlib/strtold.c
sysdeps/ieee754/float128/strtof128.c
sysdeps/ieee754/float128/strtof128_l.c
sysdeps/ieee754/ldbl-128/strtold_l.c
sysdeps/ieee754/ldbl-64-128/strtold_l.c
sysdeps/ieee754/ldbl-96/strtold_l.c

index 145080e9954a488401f407adffe096ba6935c389..b58c4e21bac1738c60d0ce486e28994613df0d90 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,40 @@
 2017-11-24  Joseph Myers  <joseph@codesourcery.com>
 
+       * stdlib/strtold.c [__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x):
+       Define and later undefine as macro.  Define as weak alias if
+       [!USE_WIDE_CHAR].
+       [__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x): Define and later
+       undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].
+       * sysdeps/ieee754/float128/strtof128.c: Include <bits/floatn.h>.
+       [__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x):
+       Define and later undefine as macro.  Define as weak alias if
+       [!USE_WIDE_CHAR].
+       [__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x):
+       Define and later undefine as macro.  Define as weak alias if
+       [USE_WIDE_CHAR].
+       * sysdeps/ieee754/float128/strtof128_l.c
+       [__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l):
+       Define and later undefine as macro.  Define as weak alias if
+       [!USE_WIDE_CHAR].
+       [__HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l):
+       Define and later undefine as macro.  Define as weak alias if
+       [USE_WIDE_CHAR].
+       * sysdeps/ieee754/ldbl-128/strtold_l.c
+       [__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later
+       undefine as macro.  Define as weak alias if [!USE_WIDE_CHAR].
+       [__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later
+       undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].
+       * sysdeps/ieee754/ldbl-64-128/strtold_l.c
+       [__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later
+       undefine as macro.  Define as weak alias if [!USE_WIDE_CHAR].
+       [__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later
+       undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].
+       * sysdeps/ieee754/ldbl-96/strtold_l.c
+       [__HAVE_FLOAT64X_LONG_DOUBLE] (strtof64x_l): Define and later
+       undefine as macro.  Define as weak alias if [!USE_WIDE_CHAR].
+       [__HAVE_FLOAT64X_LONG_DOUBLE] (wcstof64x_l): Define and later
+       undefine as macro.  Define as weak alias if [USE_WIDE_CHAR].
+
        * math/test-float64x.h: New file.
        * math/Makefile (type-float64x-yes): New variable.
        (test-types): Add $(type-float64x-$(float64x-alias-fcts)).
index 4e683b44b63941f3bd60962cfecc462174496229..167a72779853f7617923010c68b42666136ef711 100644 (file)
 # define strtof128 __hide_strtof128
 # define wcstof128 __hide_wcstof128
 #endif
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x __hide_strtof64x
+# define wcstof64x __hide_wcstof64x
+#endif
 
 #ifdef __LONG_DOUBLE_MATH_OPTIONAL
 # include <wchar.h>
@@ -78,3 +82,13 @@ weak_alias (NEW (wcstold), wcstof128)
 weak_alias (NEW (strtold), strtof128)
 # endif
 #endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x
+# undef wcstof64x
+# ifdef USE_WIDE_CHAR
+weak_alias (NEW (wcstold), wcstof64x)
+# else
+weak_alias (NEW (strtold), strtof64x)
+# endif
+#endif
index 63cc80d58d9022feed0135b30e94c7727d121dc4..e82bff6b625e60cf713f6f321c2727d0360ffe5e 100644 (file)
 /* The actual implementation for all floating point sizes is in strtod.c.
    These macros tell it to produce the `_Float128' version, `strtof128'.  */
 
+#include <bits/floatn.h>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x __hide_strtof64x
+# define wcstof64x __hide_wcstof64x
+#endif
+
 #define FLOAT          _Float128
 #define FLT            FLT128
 #ifdef USE_WIDE_CHAR
 #include <float128_private.h>
 
 #include <stdlib/strtod.c>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x
+# undef wcstof64x
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstof128, wcstof64x)
+# else
+weak_alias (strtof128, strtof64x)
+# endif
+#endif
index a541d60ef34f0c793c665d7a4775aef2be455d12..833a1360d0e9bf4cbf86fb226acaa9be858e90e6 100644 (file)
 /* Bring in potential typedef for _Float128 early for declaration below.  */
 #include <bits/floatn.h>
 
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
 extern _Float128 ____strtof128_l_internal (const char *, char **,
                                           int, locale_t);
 
@@ -41,3 +46,13 @@ extern _Float128 ____strtof128_l_internal (const char *, char **,
 #include <float128_private.h>
 
 #include <stdlib/strtod_l.c>
+
+#if __HAVE_FLOAT64X && !__HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstof128_l, wcstof64x_l)
+# else
+weak_alias (strtof128_l, strtof64x_l)
+# endif
+#endif
index ea5c91919ab34a56b6376dca330c0e87798dbb3b..c0d6b7336778135ae0c058df9f35df18c6dc419b 100644 (file)
 # define wcstof128_l __hide_wcstof128_l
 #endif
 
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
 #include <strtod_l.c>
 
 #if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
@@ -50,3 +55,13 @@ weak_alias (wcstold_l, wcstof128_l)
 weak_alias (strtold_l, strtof128_l)
 # endif
 #endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstold_l, wcstof64x_l)
+# else
+weak_alias (strtold_l, strtof64x_l)
+# endif
+#endif
index f6f717172cef23b16e1dc64e3a1a28b715ed12a3..bca493a9ff47421fa4959674df695e3e9e287e72 100644 (file)
 # define wcstof128_l __hide_wcstof128_l
 #endif
 
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
 #include <math.h>
 #include <stdlib.h>
 #include <wchar.h>
@@ -74,3 +79,13 @@ weak_alias (____new_wcstold_l, wcstof128_l)
 weak_alias (____new_strtold_l, strtof128_l)
 # endif
 #endif
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (____new_wcstold_l, wcstof64x_l)
+# else
+weak_alias (____new_strtold_l, strtof64x_l)
+# endif
+#endif
index 251f91ba9d328dd3a255e92d99b7c7c01202dd18..946bca893254895e7cb03fad67ab0b9b3561e0b4 100644 (file)
 #define MPN2FLOAT      __mpn_construct_long_double
 #define FLOAT_HUGE_VAL HUGE_VALL
 
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# define strtof64x_l __hide_strtof64x_l
+# define wcstof64x_l __hide_wcstof64x_l
+#endif
+
 #include <stdlib/strtod_l.c>
+
+#if __HAVE_FLOAT64X_LONG_DOUBLE
+# undef strtof64x_l
+# undef wcstof64x_l
+# ifdef USE_WIDE_CHAR
+weak_alias (wcstold_l, wcstof64x_l)
+# else
+weak_alias (strtold_l, strtof64x_l)
+# endif
+#endif