diff options
author | Joseph Myers <joseph@codesourcery.com> | 2017-10-16 13:22:11 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2017-10-16 13:22:11 +0000 |
commit | 02010e79ceb7989686a0c8c40878024e30fdc888 (patch) | |
tree | 808814c02c69025ba3ea915b7122d38f3a3aaa81 /sysdeps | |
parent | ea91c315bca91fe8d5c36f1aa1dc98d2f0ab4ef4 (diff) | |
download | glibc-02010e79ceb7989686a0c8c40878024e30fdc888.tar.gz |
Support strtof128 etc. aliases.
This patch adds support for building strtof128, wcstof128, strtof128_l
and wcstof128_l as aliases, in the case of __HAVE_FLOAT128 &&
!__HAVE_DISTINCT_FLOAT128.
Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by this patch. Also tested together with
changes to enable float128 aliases.
* stdlib/strtold.c: Include <bits/floatn.h>
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (strtof128): Define
and later undefine as macro. Define as weak alias if
[!USE_WIDE_CHAR].
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (wcstof128): Define
and later undefine as macro. Define as weak alias if
[USE_WIDE_CHAR].
* sysdeps/ieee754/ldbl-128/strtold_l.c [__HAVE_FLOAT128 &&
!__HAVE_DISTINCT_FLOAT128] (strtof128_l): Define and later
undefine as macro. Define as weak alias if [!USE_WIDE_CHAR].
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (wcstof128_l):
Define and later undefine as macro. Define as weak alias if
[USE_WIDE_CHAR].
* sysdeps/ieee754/ldbl-64-128/strtold_l.c: Include
<bits/floatn.h>.
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (strtof128_l):
Define and later undefine as macro. Define as weak alias if
[!USE_WIDE_CHAR].
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (wcstof128_l):
Define and later undefine as macro. Define as weak alias if
[USE_WIDE_CHAR].
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/ieee754/ldbl-128/strtold_l.c | 15 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-64-128/strtold_l.c | 17 |
2 files changed, 32 insertions, 0 deletions
diff --git a/sysdeps/ieee754/ldbl-128/strtold_l.c b/sysdeps/ieee754/ldbl-128/strtold_l.c index 4a8b14c4bb..ea5c91919a 100644 --- a/sysdeps/ieee754/ldbl-128/strtold_l.c +++ b/sysdeps/ieee754/ldbl-128/strtold_l.c @@ -34,4 +34,19 @@ #define MPN2FLOAT __mpn_construct_long_double #define FLOAT_HUGE_VAL HUGE_VALL +#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128 +# define strtof128_l __hide_strtof128_l +# define wcstof128_l __hide_wcstof128_l +#endif + #include <strtod_l.c> + +#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128 +# undef strtof128_l +# undef wcstof128_l +# ifdef USE_WIDE_CHAR +weak_alias (wcstold_l, wcstof128_l) +# else +weak_alias (strtold_l, strtof128_l) +# endif +#endif diff --git a/sysdeps/ieee754/ldbl-64-128/strtold_l.c b/sysdeps/ieee754/ldbl-64-128/strtold_l.c index b12151d579..f6f717172c 100644 --- a/sysdeps/ieee754/ldbl-64-128/strtold_l.c +++ b/sysdeps/ieee754/ldbl-64-128/strtold_l.c @@ -15,6 +15,13 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#include <bits/floatn.h> + +#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128 +# define strtof128_l __hide_strtof128_l +# define wcstof128_l __hide_wcstof128_l +#endif + #include <math.h> #include <stdlib.h> #include <wchar.h> @@ -57,3 +64,13 @@ long_double_symbol (libc, ___new_strtold_l, strtold_l); long_double_symbol (libc, ____new_strtold_l, __strtold_l); # endif #endif + +#if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128 +# undef strtof128_l +# undef wcstof128_l +# ifdef USE_WIDE_CHAR +weak_alias (____new_wcstold_l, wcstof128_l) +# else +weak_alias (____new_strtold_l, strtof128_l) +# endif +#endif |