1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

Support defining strtof32, wcstof32 aliases.

This patch adds support for defining strtof32, wcstof32, strtof32_l
and wcstof32_l functions as aliases of the corresponding float
functions when _Float32 support is enabled.

Tested for x86_64; also tested with build-many-glibcs.py in
conjunction with other _Float32 changes.

	* stdlib/strtof.c: Include <bits/floatn.h>
	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strtof32): Define
	and later undefine as macro.  Define as weak alias if
	[!USE_WIDE_CHAR].
	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (wcstof32): Define
	and later undefine as macro.  Define as weak alias if
	[USE_WIDE_CHAR].
	* stdlib/strtof_l.c: Include <bits/floatn.h>
	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strtof32_l): Define
	and later undefine as macro.  Define as weak alias if
	[!USE_WIDE_CHAR].
	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (wcstof32_l): Define
	and later undefine as macro.  Define as weak alias if
	[USE_WIDE_CHAR].
This commit is contained in:
Joseph Myers
2017-12-06 23:06:12 +00:00
parent fc10cc3f32
commit fb1ca2aa3e
3 changed files with 49 additions and 0 deletions

View File

@@ -17,6 +17,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
#include <bits/floatn.h>
#if __HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32
# define strtof32_l __hide_strtof32_l
# define wcstof32_l __hide_wcstof32_l
#endif
#include <locale.h>
extern float ____strtof_l_internal (const char *, char **, int, locale_t);
@@ -36,3 +43,13 @@ extern float ____strtof_l_internal (const char *, char **, int, locale_t);
#define FLOAT_HUGE_VAL HUGE_VALF
#include "strtod_l.c"
#if __HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32
# undef strtof32_l
# undef wcstof32_l
# ifdef USE_WIDE_CHAR
weak_alias (wcstof_l, wcstof32_l)
# else
weak_alias (strtof_l, strtof32_l)
# endif
#endif