This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Check __x86_64__ instead of __WORDSIZE in mathinline.h


Hi,

Those inline functions depend on x86-64 architecture, not __WORDSIZE.
This patch checks __x86_64__ instead of __WORDSIZE.  OK to install?

Thanks.

H.J.
---
2012-03-19  H.J. Lu  <hongjiu.lu@intel.com>
 
	* sysdeps/x86_64/fpu/bits/mathinline.h: Don't include
	<bits/wordsize.h>.
	(__signbitf): Check __x86_64__ instead of __WORDSIZE.
	(__signbit): Likwise.
	(llrintf): Likwise.
	(llrint): Likwise.

diff --git a/sysdeps/x86_64/fpu/bits/mathinline.h b/sysdeps/x86_64/fpu/bits/mathinline.h
index 5a9ce8b..c072f16 100644
--- a/sysdeps/x86_64/fpu/bits/mathinline.h
+++ b/sysdeps/x86_64/fpu/bits/mathinline.h
@@ -20,8 +20,6 @@
 # error "Never use <bits/mathinline.h> directly; include <math.h> instead."
 #endif
 
-#include <bits/wordsize.h>
-
 #ifndef __extern_always_inline
 # define __MATH_INLINE __inline
 #else
@@ -38,7 +36,7 @@ __BEGIN_NAMESPACE_C99
 __MATH_INLINE int
 __NTH (__signbitf (float __x))
 {
-# if __WORDSIZE == 32
+# ifndef __x86_64__
   __extension__ union { float __f; int __i; } __u = { __f: __x };
   return __u.__i < 0;
 # else
@@ -50,7 +48,7 @@ __NTH (__signbitf (float __x))
 __MATH_INLINE int
 __NTH (__signbit (double __x))
 {
-# if __WORDSIZE == 32
+# ifndef __x86_64__
   __extension__ union { double __d; int __i[2]; } __u = { __d: __x };
   return __u.__i[1] < 0;
 # else
@@ -94,7 +92,7 @@ __NTH (lrint (double __x))
   return __res;
 }
 #  endif
-#  if __WORDSIZE == 64
+#  ifdef __x86_64__
 __MATH_INLINE long long int
 __NTH (llrintf (float __x))
 {
-- 
1.7.6.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]