diff options
author | Joseph Myers <joseph@codesourcery.com> | 2017-11-24 22:51:53 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2017-11-24 22:51:53 +0000 |
commit | 0df4fe3557bfbc7fc64a05601311da0365ba88b2 (patch) | |
tree | 29bbea875385548ca0a10809e160d8da85b487f2 /sysdeps | |
parent | ae7207d033481191bdbf46f18afbb2fad0397730 (diff) | |
download | glibc-0df4fe3557bfbc7fc64a05601311da0365ba88b2.zip glibc-0df4fe3557bfbc7fc64a05601311da0365ba88b2.tar.gz glibc-0df4fe3557bfbc7fc64a05601311da0365ba88b2.tar.bz2 |
Support strtof64x, wcstof64x aliases.
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].
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/ieee754/float128/strtof128.c | 17 | ||||
-rw-r--r-- | sysdeps/ieee754/float128/strtof128_l.c | 15 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/strtold_l.c | 15 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-64-128/strtold_l.c | 15 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/strtold_l.c | 15 |
5 files changed, 77 insertions, 0 deletions
diff --git a/sysdeps/ieee754/float128/strtof128.c b/sysdeps/ieee754/float128/strtof128.c index 63cc80d..e82bff6 100644 --- a/sysdeps/ieee754/float128/strtof128.c +++ b/sysdeps/ieee754/float128/strtof128.c @@ -19,6 +19,13 @@ /* 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 @@ -32,3 +39,13 @@ #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 diff --git a/sysdeps/ieee754/float128/strtof128_l.c b/sysdeps/ieee754/float128/strtof128_l.c index a541d60..833a136 100644 --- a/sysdeps/ieee754/float128/strtof128_l.c +++ b/sysdeps/ieee754/float128/strtof128_l.c @@ -21,6 +21,11 @@ /* 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 diff --git a/sysdeps/ieee754/ldbl-128/strtold_l.c b/sysdeps/ieee754/ldbl-128/strtold_l.c index ea5c919..c0d6b73 100644 --- a/sysdeps/ieee754/ldbl-128/strtold_l.c +++ b/sysdeps/ieee754/ldbl-128/strtold_l.c @@ -39,6 +39,11 @@ # 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 diff --git a/sysdeps/ieee754/ldbl-64-128/strtold_l.c b/sysdeps/ieee754/ldbl-64-128/strtold_l.c index f6f7171..bca493a 100644 --- a/sysdeps/ieee754/ldbl-64-128/strtold_l.c +++ b/sysdeps/ieee754/ldbl-64-128/strtold_l.c @@ -22,6 +22,11 @@ # 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 diff --git a/sysdeps/ieee754/ldbl-96/strtold_l.c b/sysdeps/ieee754/ldbl-96/strtold_l.c index 251f91b..946bca8 100644 --- a/sysdeps/ieee754/ldbl-96/strtold_l.c +++ b/sysdeps/ieee754/ldbl-96/strtold_l.c @@ -34,4 +34,19 @@ #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 |