diff options
| -rw-r--r-- | include/endianness.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/endianness.h b/include/endianness.h index a34cbf4..1f99fa7 100644 --- a/include/endianness.h +++ b/include/endianness.h | |||
| @@ -1,6 +1,24 @@ | |||
| 1 | #ifndef ENDIANNESS_H | 1 | #ifndef ENDIANNESS_H |
| 2 | #define ENDIANNESS_H | 2 | #define ENDIANNESS_H |
| 3 | 3 | ||
| 4 | #ifndef __LITTLE_ENDIAN | ||
| 5 | #define __LITTLE_ENDIAN 1234 | ||
| 6 | #endif | ||
| 7 | |||
| 8 | #ifndef __BIG_ENDIAN | ||
| 9 | #define __BIG_ENDIAN 4321 | ||
| 10 | #endif | ||
| 11 | |||
| 12 | #ifndef __BYTE_ORDER | ||
| 13 | #ifdef __LITTLE_ENDIAN__ | ||
| 14 | #define __BYTE_ORDER __LITTLE_ENDIAN | ||
| 15 | #else | ||
| 16 | #ifdef __BIG_ENDIAN__ | ||
| 17 | #define __BYTE_ORDER __BIG_ENDIAN | ||
| 18 | #endif | ||
| 19 | #endif | ||
| 20 | #endif | ||
| 21 | |||
| 4 | #ifndef be16toh | 22 | #ifndef be16toh |
| 5 | #if __BYTE_ORDER == __BIG_ENDIAN | 23 | #if __BYTE_ORDER == __BIG_ENDIAN |
| 6 | #define be16toh(x) (x) | 24 | #define be16toh(x) (x) |
