Include <endian.h> as fallback for endianness
Include <endian.h> if none of __ORDER_LITTLE_ENDIAN__ and __ORDER_BIG_ENDIAN__ are predefined (too old version of gcc) in order to determine endianness.
This commit is contained in:
parent
a8f2de4912
commit
b26e46a5ae
9
pstack.c
9
pstack.c
|
@ -85,10 +85,19 @@
|
|||
#ifdef __ORDER_LITTLE_ENDIAN__
|
||||
#define ELF_EI_DATA ELFDATA2LSB
|
||||
#define ELF_ENDIANNESS_ERRSTR "big"
|
||||
#elif defined(__ORDER_BIG_ENDIAN__)
|
||||
#define ELF_EI_DATA ELFDATA2MSB
|
||||
#define ELF_ENDIANNESS_ERRSTR "little"
|
||||
#else
|
||||
#include <endian.h>
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#define ELF_EI_DATA ELFDATA2LSB
|
||||
#define ELF_ENDIANNESS_ERRSTR "big"
|
||||
#else
|
||||
#define ELF_EI_DATA ELFDATA2MSB
|
||||
#define ELF_ENDIANNESS_ERRSTR "little"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Machine dependant: ELF machine name, registers name and stack layout */
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
|
|
Loading…
Reference in New Issue