From 7635b30f9d62e33b057d830780a937c6c1d140f5 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 14 Dec 2005 02:33:36 +0000 Subject: 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(). --- libm/powerpc/s_floor.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libm/powerpc/s_floor.c') diff --git a/libm/powerpc/s_floor.c b/libm/powerpc/s_floor.c index 94677b4d2..0ddbb9b66 100644 --- a/libm/powerpc/s_floor.c +++ b/libm/powerpc/s_floor.c @@ -21,13 +21,15 @@ * * *******************************************************************************/ +#include + static const double twoTo52 = 4503599627370496.0; static const unsigned long signMask = 0x80000000ul; typedef union { struct { -#if defined(__BIG_ENDIAN__) +#if (__BYTE_ORDER == __BIG_ENDIAN) unsigned long int hi; unsigned long int lo; #else -- cgit v1.2.3