Use __BYTE_ORDER macro to check system endianess as the macro's
__LITTLE_ENDIAN, __BIG_ENDIAN are defined irrespective of the
sytem endianess leading to an endianess check failure on big
endian systems.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Acked-by: John Crispin <john@phrozen.org>
int clazz = map[EI_CLASS];
int endian = map[EI_DATA];
-#if defined(__LITTLE_ENDIAN)
+#if __BYTE_ORDER == __LITTLE_ENDIAN
if (endian != ELFDATA2LSB)
-#elif defined(__BIG_ENDIAN)
+#elif __BYTE_ORDER == __BIG_ENDIAN
if (endian != ELFDATA2MSB)
#else
#error "unsupported endian"