Rizin
unix-like reverse engineering framework and cli tools
host.h
Go to the documentation of this file.
1 
2 // Determine endian and pointer size based on known defines.
3 // TS_BIG_ENDIAN and TS_PTR_SIZE can be set as -D compiler arguments
4 // to override this.
5 
6 #if !defined(TS_BIG_ENDIAN)
7 #if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) \
8  || (defined( __APPLE_CC__) && (defined(__ppc__) || defined(__ppc64__)))
9 #define TS_BIG_ENDIAN 1
10 #else
11 #define TS_BIG_ENDIAN 0
12 #endif
13 #endif
14 
15 #if !defined(TS_PTR_SIZE)
16 #if UINTPTR_MAX == 0xFFFFFFFF
17 #define TS_PTR_SIZE 32
18 #else
19 #define TS_PTR_SIZE 64
20 #endif
21 #endif