From a8b6aad155d7adf8e2c47f944e5328223d2baaab Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 11 Feb 2014 12:03:08 -0800 Subject: [PATCH] fix missing __BIG_ENDIAN__ definition on some platform e.g: mips-gcc doesn't define __BIG_ENDIAN__ Change-Id: Ic06bf453164ddddc69a523e7845a4993e14a1af2 --- src/utils/bit_reader.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/bit_reader.h b/src/utils/bit_reader.h index 6c6a345a..55965d74 100644 --- a/src/utils/bit_reader.h +++ b/src/utils/bit_reader.h @@ -86,6 +86,12 @@ extern "C" { #endif +// some endian fix (e.g.: mips-gcc doesn't define __BIG_ENDIAN__) +#if !defined(__BIG_ENDIAN__) && defined(__BYTE_ORDER__) && \ + (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) +#define __BIG_ENDIAN__ +#endif + //------------------------------------------------------------------------------ // Derived types and constants