summaryrefslogtreecommitdiffstats
path: root/lib/libc/powerpc/gen/infinity.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/powerpc/gen/infinity.c')
-rw-r--r--lib/libc/powerpc/gen/infinity.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/libc/powerpc/gen/infinity.c b/lib/libc/powerpc/gen/infinity.c
index cf1695e..f532438 100644
--- a/lib/libc/powerpc/gen/infinity.c
+++ b/lib/libc/powerpc/gen/infinity.c
@@ -11,7 +11,20 @@ __FBSDID("$FreeBSD$");
#include <math.h>
/* bytes for +Infinity on powerpc */
-const union __infinity_un __infinity = { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
+const union __infinity_un __infinity = {
+#if BYTE_ORDER == BIG_ENDIAN
+ { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
+#else
+ { 0, 0, 0, 0, 0, 0, 0xf0, 0x7f }
+#endif
+};
/* bytes for NaN */
-const union __nan_un __nan = { { 0xff, 0xc0, 0, 0 } };
+const union __nan_un __nan = {
+#if BYTE_ORDER == BIG_ENDIAN
+ {0xff, 0xc0, 0, 0}
+#else
+ { 0, 0, 0xc0, 0xff }
+#endif
+};
+
OpenPOWER on IntegriCloud