diff options
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/stdlib/strtod.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/libc/stdlib/strtod.c b/lib/libc/stdlib/strtod.c index f8ed1c3df610..5065dac7d6e1 100644 --- a/lib/libc/stdlib/strtod.c +++ b/lib/libc/stdlib/strtod.c @@ -217,12 +217,16 @@ extern "C" { Exactly one of IEEE_8087, IEEE_MC68k, VAX, or IBM should be defined. #endif +union doubleasulongs { + double x; + unsigned long w[2]; +}; #ifdef IEEE_8087 -#define word0(x) ((unsigned long *)&x)[1] -#define word1(x) ((unsigned long *)&x)[0] +#define word0(x) (((union doubleasulongs *)&x)->w)[1] +#define word1(x) (((union doubleasulongs *)&x)->w)[0] #else -#define word0(x) ((unsigned long *)&x)[0] -#define word1(x) ((unsigned long *)&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. |
