[PATCHv2,2/5] ldbl-128: Define and use mathx_hidden_def wrapper to hidden_def
diff mbox

Message ID 794b522acd98f7da80d39d56d2bcb27cfc520e0b.1471548450.git.murphyp@linux.vnet.ibm.com
State New
Headers show

Commit Message

Paul E. Murphy Aug. 18, 2016, 7:42 p.m. UTC
This provides an extra macro expansion before invoking
the hidden_def macro.  This removes the need for ugly
workarounds when building these files as float128.

	* sysdeps/generic/math_private.h:
	(mathx_hidden_def): New macro.
	* sysdeps/ieee754/ldbl-128/s_finitel.c: Replace
	hidden_def usage with mathx_hidden_def.
	* sysdeps/ieee754/ldbl-128/s_isinfl.c: Likewise.
	* sysdeps/ieee754/ldbl-128/s_isnanl.c: Likewise.
---
 sysdeps/generic/math_private.h       | 4 ++++
 sysdeps/ieee754/ldbl-128/s_finitel.c | 2 +-
 sysdeps/ieee754/ldbl-128/s_isinfl.c  | 2 +-
 sysdeps/ieee754/ldbl-128/s_isnanl.c  | 2 +-
 4 files changed, 7 insertions(+), 3 deletions(-)

Comments

Joseph Myers Aug. 18, 2016, 9:08 p.m. UTC | #1
On Thu, 18 Aug 2016, Paul E. Murphy wrote:

> +/* We need to guarantee an expansion of name when building
> +   ldbl-128 files as another type (e.g _Float128).  */
> +#define mathx_hidden_def(name) hidden_def(name)

Space before '(' in call to hidden_def, and "e.g" should be "e.g.".  But 
really I'd rather see this patch in the context of a later patch series 
where it's actually used; it may well be the right approach, but that 
isn't entirely clear for the patch in isolation / in the present series.

Patch
diff mbox

diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index cf1865d..08b04e0 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -181,6 +181,10 @@  do {								\
 } while (0)
 #endif
 
+/* We need to guarantee an expansion of name when building
+   ldbl-128 files as another type (e.g _Float128).  */
+#define mathx_hidden_def(name) hidden_def(name)
+
 /* Get long double macros from a separate header.  */
 #include <math_ldbl.h>
 
diff --git a/sysdeps/ieee754/ldbl-128/s_finitel.c b/sysdeps/ieee754/ldbl-128/s_finitel.c
index ea8a9ba..25450ba 100644
--- a/sysdeps/ieee754/ldbl-128/s_finitel.c
+++ b/sysdeps/ieee754/ldbl-128/s_finitel.c
@@ -32,5 +32,5 @@  int __finitel(long double x)
 	return (int)((u_int64_t)((hx&0x7fff000000000000LL)
 				 -0x7fff000000000000LL)>>63);
 }
-hidden_def (__finitel)
+mathx_hidden_def (__finitel)
 weak_alias (__finitel, finitel)
diff --git a/sysdeps/ieee754/ldbl-128/s_isinfl.c b/sysdeps/ieee754/ldbl-128/s_isinfl.c
index 03e4d13..0066a57 100644
--- a/sysdeps/ieee754/ldbl-128/s_isinfl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isinfl.c
@@ -25,5 +25,5 @@  __isinfl (long double x)
 	lx |= -lx;
 	return ~(lx >> 63) & (hx >> 62);
 }
-hidden_def (__isinfl)
+mathx_hidden_def (__isinfl)
 weak_alias (__isinfl, isinfl)
diff --git a/sysdeps/ieee754/ldbl-128/s_isnanl.c b/sysdeps/ieee754/ldbl-128/s_isnanl.c
index 74960e7..297a669 100644
--- a/sysdeps/ieee754/ldbl-128/s_isnanl.c
+++ b/sysdeps/ieee754/ldbl-128/s_isnanl.c
@@ -34,5 +34,5 @@  int __isnanl(long double x)
 	hx = 0x7fff000000000000LL - hx;
 	return (int)((u_int64_t)hx>>63);
 }
-hidden_def (__isnanl)
+mathx_hidden_def (__isnanl)
 weak_alias (__isnanl, isnanl)