summaryrefslogtreecommitdiff
path: root/libm/powerpc/s_modf.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-12-14 02:33:36 +0000
committerEric Andersen <andersen@codepoet.org>2005-12-14 02:33:36 +0000
commit7635b30f9d62e33b057d830780a937c6c1d140f5 (patch)
tree9991bb6bc9f6233ed784521c588cf9e90c8520b3 /libm/powerpc/s_modf.c
parentf32600208f4e9db972eb47f7d4959994b31199e6 (diff)
Fixup byte order handling. Not all architectures define __BIG_ENDIAN__ so i.e.
on big endian mips the code is compiled as little-endian and the wrong half of the 64-bit point value is examined to check for NaN, etc. This bug also broke fpclassify(), isfinite(), isnormal(), isinf(), finite(), and signbit().
Diffstat (limited to 'libm/powerpc/s_modf.c')
-rw-r--r--libm/powerpc/s_modf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libm/powerpc/s_modf.c b/libm/powerpc/s_modf.c
index f4344bda8..cb8338a90 100644
--- a/libm/powerpc/s_modf.c
+++ b/libm/powerpc/s_modf.c
@@ -45,13 +45,14 @@
#include <limits.h>
#include <math.h>
+#include <endian.h>
#define SET_INVALID 0x01000000UL
typedef union
{
struct {
-#if defined(__BIG_ENDIAN__)
+#if (__BYTE_ORDER == __BIG_ENDIAN)
unsigned long int hi;
unsigned long int lo;
#else