From 4b1f834e016093a0c8ef7ca4222d7129c7a1c5af Mon Sep 17 00:00:00 2001 From: fincs Date: Thu, 11 Dec 2014 00:38:25 +0100 Subject: [PATCH] __BYTE_ORDER__ not supported on GCC 4.0 --- source/types.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/types.h b/source/types.h index 4822231..16140d0 100644 --- a/source/types.h +++ b/source/types.h @@ -17,6 +17,13 @@ typedef uint8_t u8; #define BIT(n) (1U << (n)) #if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) +#ifndef __BYTE_ORDER__ +#include +#define __BYTE_ORDER__ BYTE_ORDER +#define __ORDER_LITTLE_ENDIAN__ LITTLE_ENDIAN +#define __ORDER_BIG_ENDIAN__ BIG_ENDIAN +#endif + static inline uint16_t __builtin_bswap16(uint16_t x) { return ((x << 8) & 0xff00) | ((x >> 8) & 0x00ff);