musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/include/math.h
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2014年03月09日 19:29:41 +0100
committerSzabolcs Nagy <nsz@port70.net>2014年03月09日 19:29:41 +0100
commit6739b13a172aad9c01572c04cadacc99c7041811 (patch)
tree761c1e32604fa036aa02e4d9f73fb5459724693c /include/math.h
parent9743a399bf4d6da9a1dbdf7e8df07284c97df16f (diff)
downloadmusl-6739b13a172aad9c01572c04cadacc99c7041811.tar.gz
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).
Diffstat (limited to 'include/math.h')
-rw-r--r--include/math.h 6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/math.h b/include/math.h
index bbee62e2..6ac91da2 100644
--- a/include/math.h
+++ b/include/math.h
@@ -42,12 +42,14 @@ int __fpclassifyl(long double);
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;
}
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;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月02日 12:39:54 +0000

AltStyle によって変換されたページ (->オリジナル) /