summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/strtod.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libc/stdlib/strtod.c b/lib/libc/stdlib/strtod.c
index eaa7ad0..9295583 100644
--- a/lib/libc/stdlib/strtod.c
+++ b/lib/libc/stdlib/strtod.c
@@ -222,12 +222,16 @@ extern "C" {
Only one of IEEE_LITTLE_ENDIAN, IEEE_BIG_ENDIAN, VAX, or IBM should be defined.
#endif
+union doubleasulongs {
+ double x;
+ ULong w[2];
+};
#ifdef IEEE_LITTLE_ENDIAN
-#define word0(x) ((ULong *)&x)[1]
-#define word1(x) ((ULong *)&x)[0]
+#define word0(x) (((union doubleasulongs *)&x)->w)[1]
+#define word1(x) (((union doubleasulongs *)&x)->w)[0]
#else
-#define word0(x) ((ULong *)&x)[0]
-#define word1(x) ((ULong *)&x)[1]
+#define word0(x) (((union doubleasulongs *)&x)->w)[0]
+#define word1(x) (((union doubleasulongs *)&x)->w)[1]
#endif
/* The following definition of Storeinc is appropriate for MIPS processors.
OpenPOWER on IntegriCloud