From 835a2492a2055faf286f04cfb89c8aac93c7f8b9 Mon Sep 17 00:00:00 2001 From: ghidra1 Date: Tue, 16 Nov 2021 17:59:49 -0500 Subject: [PATCH] GP-0 allow decompiler to build for x86 with older compiler (e.g., g++ 4.8.5) --- Ghidra/Features/Decompiler/src/decompile/cpp/types.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/types.h b/Ghidra/Features/Decompiler/src/decompile/cpp/types.h index 93843432da..c342f3d9a7 100644 --- a/Ghidra/Features/Decompiler/src/decompile/cpp/types.h +++ b/Ghidra/Features/Decompiler/src/decompile/cpp/types.h @@ -37,11 +37,16 @@ typedef int8_t int1; /* uintp is intended to be an unsigned integer that is the same size as a pointer */ 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 { public: static constexpr const union { int4 whole; int1 part[4]; } host = { 1 }; }; #define HOST_ENDIAN Endian::host.part[3] +#endif #if defined(_WINDOWS) #pragma warning (disable:4312)