diff options
author | Elliott Hughes <enh@google.com> | 2010-05-14 18:13:29 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2010-05-14 18:21:00 -0700 |
commit | f554229f9293b078b77205f37e679105115a7056 (patch) | |
tree | c321e78cc98942bba489692024414857ac41615f /luni/src/main/native/fltconst.h | |
parent | 4ccac1d702ac77c52819918af42a215040bc2db1 (diff) | |
download | libcore-f554229f9293b078b77205f37e679105115a7056.zip libcore-f554229f9293b078b77205f37e679105115a7056.tar.gz libcore-f554229f9293b078b77205f37e679105115a7056.tar.bz2 |
More cleanup of "hycomp.h".
This makes sure we ask the system whether it's big- or little-endian, and
doesn't make assumptions about the sizes of built-in types.
This fixes a regression I introduced last week with the previous cleanup,
affecting the double/string conversions. We still fail some of those tests,
but now we're back to only failing the ones we've always failed...
Change-Id: I343c363b01fc34b32a4d5afbc153bfe4c0161137
Diffstat (limited to 'luni/src/main/native/fltconst.h')
-rw-r--r-- | luni/src/main/native/fltconst.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/luni/src/main/native/fltconst.h b/luni/src/main/native/fltconst.h index d96c5bb..a5ed1c8 100644 --- a/luni/src/main/native/fltconst.h +++ b/luni/src/main/native/fltconst.h @@ -18,7 +18,31 @@ #if !defined(fltconst_h) #define fltconst_h -#include "hycomp.h" +#include <sys/types.h> +#include <sys/param.h> +#if __BYTE_ORDER == __LITTLE_ENDIAN +#define HY_LITTLE_ENDIAN +#elif __BYTE_ORDER == __BIG_ENDIAN +#define HY_BIG_ENDIAN +#endif + +/** + * By default order doubles in the native (that is big/little endian) ordering. + */ +#define HY_PLATFORM_DOUBLE_ORDER + +#include <stdint.h> + +typedef int32_t I_32; +typedef uint32_t U_32; +typedef uint64_t U_64; + +typedef I_32 IDATA; +typedef U_32 UDATA; + +#define U32(x) ((U_32) (x)) +#define I32(x) ((I_32) (x)) +#define U32P(x) ((U_32 *) (x)) /* IEEE floats consist of: sign bit, exponent field, significand field single: 31 = sign bit, 30..23 = exponent (8 bits), 22..0 = significand (23 bits) |