py: Add further autodetection of endianess in mpconfig.h.

This patch was needed for gcc 4.4.
pull/1298/head
Damien George 2015-05-30 23:12:30 +01:00
rodzic 26b512ea1b
commit 4e4772bb5b
1 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -711,7 +711,16 @@ typedef double mp_float_t;
#elif defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN) || defined (_BIG_ENDIAN)
#define MP_ENDIANNESS_LITTLE (0)
#else
#error endianness not defined and cannot detect it
#include <endian.h>
#if defined(__BYTE_ORDER)
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define MP_ENDIANNESS_LITTLE (1)
#else
#define MP_ENDIANNESS_LITTLE (0)
#endif
#else
#error endianness not defined and cannot detect it
#endif
#endif
#define MP_ENDIANNESS_BIG (!MP_ENDIANNESS_LITTLE)
#endif