diff options
author | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2016-02-26 20:38:23 +0000 |
---|---|---|
committer | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2016-02-26 20:38:23 +0000 |
commit | 97a5390e6ddbe408a6ec8320d9081277d6ec6960 (patch) | |
tree | f156c494d5b9165579ab97397af3b44bc43bb3ca /lib/libc/powerpc/_fpmath.h | |
parent | 81e802c14b03fb2405a5231a9f4a5be7f809f886 (diff) |
Make unions in PowerPC libc endian-safe.
Notes
Notes:
svn path=/head/; revision=296113
Diffstat (limited to 'lib/libc/powerpc/_fpmath.h')
-rw-r--r-- | lib/libc/powerpc/_fpmath.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libc/powerpc/_fpmath.h b/lib/libc/powerpc/_fpmath.h index 6d80eb4bdf4e..4b7971e4da8a 100644 --- a/lib/libc/powerpc/_fpmath.h +++ b/lib/libc/powerpc/_fpmath.h @@ -29,10 +29,17 @@ union IEEEl2bits { long double e; struct { +#if _BYTE_ORDER == _LITTLE_ENDIAN + unsigned int manl :32; + unsigned int manh :20; + unsigned int exp :11; + unsigned int sign :1; +#else /* _BYTE_ORDER == _LITTLE_ENDIAN */ unsigned int sign :1; unsigned int exp :11; unsigned int manh :20; unsigned int manl :32; +#endif } bits; }; |