GP-0 allow decompiler to build for x86 with older compiler (e.g., g++

4.8.5)
This commit is contained in:
ghidra1 2021-11-16 17:59:49 -05:00
parent 196f7d1344
commit 835a2492a2

View file

@ -37,11 +37,16 @@ typedef int8_t int1;
/* uintp is intended to be an unsigned integer that is the same size as a pointer */ /* uintp is intended to be an unsigned integer that is the same size as a pointer */
typedef uintptr_t uintp; typedef uintptr_t uintp;
#if defined (__x86_64__) || defined (__i386__)
#define HOST_ENDIAN 0
#else // other platforms (not compatible with g++ 4.8.5)
class Endian { class Endian {
public: public:
static constexpr const union { int4 whole; int1 part[4]; } host = { 1 }; static constexpr const union { int4 whole; int1 part[4]; } host = { 1 };
}; };
#define HOST_ENDIAN Endian::host.part[3] #define HOST_ENDIAN Endian::host.part[3]
#endif
#if defined(_WINDOWS) #if defined(_WINDOWS)
#pragma warning (disable:4312) #pragma warning (disable:4312)