Mercurial > libpst
comparison src/libpst.h @ 90:631d02d30a1c
More fixes for 32/64 bit portability on big endian ppc.
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Tue, 05 Aug 2008 11:52:29 -0700 |
parents | 3ec5ad97e926 |
children | 997cf1373f9e |
comparison
equal
deleted
inserted
replaced
89:156213d65958 | 90:631d02d30a1c |
---|---|
31 #include <sys/param.h> | 31 #include <sys/param.h> |
32 #endif // defined _MSC_VER | 32 #endif // defined _MSC_VER |
33 | 33 |
34 #if BYTE_ORDER == BIG_ENDIAN | 34 #if BYTE_ORDER == BIG_ENDIAN |
35 # define LE64_CPU(x) \ | 35 # define LE64_CPU(x) \ |
36 x = ((((x) & 0xff00000000000000) >> 56) | \ | 36 x = ((((x) & UINT64_C(0xff00000000000000)) >> 56) | \ |
37 (((x) & 0x00ff000000000000) >> 40) | \ | 37 (((x) & UINT64_C(0x00ff000000000000)) >> 40) | \ |
38 (((x) & 0x0000ff0000000000) >> 24) | \ | 38 (((x) & UINT64_C(0x0000ff0000000000)) >> 24) | \ |
39 (((x) & 0x000000ff00000000) >> 8 ) | \ | 39 (((x) & UINT64_C(0x000000ff00000000)) >> 8 ) | \ |
40 (((x) & 0x00000000ff000000) << 8 ) | \ | 40 (((x) & UINT64_C(0x00000000ff000000)) << 8 ) | \ |
41 (((x) & 0x0000000000ff0000) << 24) | \ | 41 (((x) & UINT64_C(0x0000000000ff0000)) << 24) | \ |
42 (((x) & 0x000000000000ff00) << 40) | \ | 42 (((x) & UINT64_C(0x000000000000ff00)) << 40) | \ |
43 (((x) & 0x00000000000000ff) << 56)); | 43 (((x) & UINT64_C(0x00000000000000ff)) << 56)); |
44 # define LE32_CPU(x) \ | 44 # define LE32_CPU(x) \ |
45 x = ((((x) & 0xff000000) >> 24) | \ | 45 x = ((((x) & 0xff000000) >> 24) | \ |
46 (((x) & 0x00ff0000) >> 8 ) | \ | 46 (((x) & 0x00ff0000) >> 8 ) | \ |
47 (((x) & 0x0000ff00) << 8 ) | \ | 47 (((x) & 0x0000ff00) << 8 ) | \ |
48 (((x) & 0x000000ff) << 24)); | 48 (((x) & 0x000000ff) << 24)); |