about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-12-06 22:44:56 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-12-06 22:44:56 +0000
commitfc10cc3f3223f1fa8c8dcc6743d18d1392808d71 (patch)
treeb453a9fca332a6aa571af60fc171a4d36e94d1f6
parente420d22826e081372d96af39f1f5a1fd4bb913a3 (diff)
downloadglibc-fc10cc3f3223f1fa8c8dcc6743d18d1392808d71.tar.gz
glibc-fc10cc3f3223f1fa8c8dcc6743d18d1392808d71.tar.xz
glibc-fc10cc3f3223f1fa8c8dcc6743d18d1392808d71.zip
Support defining strfromf32 alias.
This patch adds support for defining strfromf32 as an alias of
strfromf when _Float32 support is enabled.

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

	* stdlib/strfromf.c: Include <bits/floatn.h>.
	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strfromf32): Define
	and later undefine as macro and define as weak alias.
-rw-r--r--ChangeLog4
-rw-r--r--stdlib/strfromf.c16
2 files changed, 20 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 96487186dd..fc455ae577 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2017-12-06  Joseph Myers  <joseph@codesourcery.com>
 
+	* stdlib/strfromf.c: Include <bits/floatn.h>.
+	[__HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32] (strfromf32): Define
+	and later undefine as macro and define as weak alias.
+
 	* math/test-float32.h: New file.
 
 	* sysdeps/generic/libm-alias-float.h: Include <bits/floatn.h>.
diff --git a/stdlib/strfromf.c b/stdlib/strfromf.c
index 20c674414d..01bed92ac1 100644
--- a/stdlib/strfromf.c
+++ b/stdlib/strfromf.c
@@ -16,7 +16,23 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <bits/floatn.h>
+
 #define FLOAT		float
 #define STRFROM		strfromf
 
+#if __HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32
+# define strfromf32 __hide_strfromf32
+#endif
+
+#include <stdlib.h>
+
+#if __HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32
+# undef strfromf32
+#endif
+
 #include "strfrom-skeleton.c"
+
+#if __HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32
+weak_alias (strfromf, strfromf32)
+#endif