Browse Source

math.h: make __FLOAT_BITS and __DOUBLE_BITS C89

Remove non-constant aggregate initializer. (Still using long long, but
that is supported by ancient compilers without __extension__ anyway).
Szabolcs Nagy 11 years ago
parent
commit
6739b13a17
1 changed files with 4 additions and 2 deletions
  1. 4 2
      include/math.h

+ 4 - 2
include/math.h

@@ -42,12 +42,14 @@ int __fpclassifyl(long double);
 
 
 static __inline unsigned __FLOAT_BITS(float __f)
 static __inline unsigned __FLOAT_BITS(float __f)
 {
 {
-	union {float __f; unsigned __i;} __u = {__f};
+	union {float __f; unsigned __i;} __u;
+	__u.__f = __f;
 	return __u.__i;
 	return __u.__i;
 }
 }
 static __inline unsigned long long __DOUBLE_BITS(double __f)
 static __inline unsigned long long __DOUBLE_BITS(double __f)
 {
 {
-	union {double __f; unsigned long long __i;} __u = {__f};
+	union {double __f; unsigned long long __i;} __u;
+	__u.__f = __f;
 	return __u.__i;
 	return __u.__i;
 }
 }