From e622e365dda997a1a4c5e0496074a589d50c517c Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 12 Jan 2022 21:56:29 +0100 Subject: [PATCH] Maintain only one patch for all the changes in types.h --- ...15-Support-ARM-AArch64-in-Decompiler.patch | 32 ---------- ...18-Add-FreeBSD-and-OpenBSD-support-6.patch | 61 +++++++++++++------ ...ype-definitions-for-m1-compilation-1.patch | 13 ---- 3 files changed, 43 insertions(+), 63 deletions(-) delete mode 100644 patches/0015-Support-ARM-AArch64-in-Decompiler.patch delete mode 100644 patches/0019-Add-aarch64-to-type-definitions-for-m1-compilation-1.patch diff --git a/patches/0015-Support-ARM-AArch64-in-Decompiler.patch b/patches/0015-Support-ARM-AArch64-in-Decompiler.patch deleted file mode 100644 index 214986d..0000000 --- a/patches/0015-Support-ARM-AArch64-in-Decompiler.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/src/decompiler/types.h b/src/decompiler/types.h -index d109066..ff6f423 100644 ---- a/src/decompiler/types.h -+++ b/src/decompiler/types.h -@@ -71,8 +71,12 @@ typedef char int1; - typedef uint8 uintp; - #endif - --#if defined (__linux__) && defined (__i386__) -+#if defined (__linux__) && (defined (__i386__) || defined (__arm__)) -+#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -+#define HOST_ENDIAN 1 -+#else - #define HOST_ENDIAN 0 -+#endif - typedef unsigned long uintm; - typedef long intm; - typedef unsigned long long uint8; -@@ -86,8 +90,12 @@ typedef char int1; - typedef uint4 uintp; - #endif - --#if defined (__linux__) && defined (__x86_64__) -+#if defined (__linux__) && (defined (__x86_64__) || defined (__aarch64__)) -+#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -+#define HOST_ENDIAN 1 -+#else - #define HOST_ENDIAN 0 -+#endif - typedef unsigned int uintm; - typedef int intm; - typedef unsigned long uint8; diff --git a/patches/0018-Add-FreeBSD-and-OpenBSD-support-6.patch b/patches/0018-Add-FreeBSD-and-OpenBSD-support-6.patch index b6455f8..3ceb00b 100644 --- a/patches/0018-Add-FreeBSD-and-OpenBSD-support-6.patch +++ b/patches/0018-Add-FreeBSD-and-OpenBSD-support-6.patch @@ -1,29 +1,54 @@ diff --git a/src/decompiler/types.h b/src/decompiler/types.h -index d109066..19c8fd4 100644 +index d109066..8d2df57 100644 --- a/src/decompiler/types.h +++ b/src/decompiler/types.h -@@ -25,6 +25,11 @@ +@@ -25,6 +25,12 @@ #ifndef __MYTYPES__ #define __MYTYPES__ -+#if (defined (__NetBSD__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__HAIKU__)) -+#undef __linux__ -+#define __linux__ 1 ++#if defined (__linux__) || defined (__NetBSD__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__HAIKU__) ++#define __MODERN_UNIX__ 1 ++#else ++#define __MODERN_UNIX__ 0 +#endif + #if defined( __sparc ) #define HOST_ENDIAN 1 #if defined( __sparcv9 ) -@@ -14,3 +14,12 @@ index d109066..19c8fd4 100644 - #if defined( __sparc ) - #define HOST_ENDIAN 1 - #if defined( __sparcv9 ) -+@@ -261,4 +274,8 @@ CPUI_DEBUG -- This is the ONE debug switch that should be passed in -+ //# define VARBANK_DEBUG -+ #endif -+ -++#if (defined (__NetBSD__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__HAIKU__)) -++#undef __linux__ -++#endif -++ -+ #endif +@@ -71,8 +77,12 @@ typedef char int1; + typedef uint8 uintp; + #endif + +-#if defined (__linux__) && defined (__i386__) ++#if defined (__MODERN_UNIX__) && (defined (__i386__) || defined (__arm__)) ++#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ++#define HOST_ENDIAN 1 ++#else + #define HOST_ENDIAN 0 ++#endif + typedef unsigned long uintm; + typedef long intm; + typedef unsigned long long uint8; +@@ -86,8 +96,12 @@ typedef char int1; + typedef uint4 uintp; + #endif + +-#if defined (__linux__) && defined (__x86_64__) ++#if defined (__MODERN_UNIX__) && (defined (__x86_64__) || defined (__aarch64__)) ++#if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ++#define HOST_ENDIAN 1 ++#else + #define HOST_ENDIAN 0 ++#endif + typedef unsigned int uintm; + typedef int intm; + typedef unsigned long uint8; +@@ -166,7 +180,7 @@ typedef char int1; + typedef uint4 uintp; + #endif + +-#if defined (__APPLE_CC__) && defined (__x86_64__) ++#if defined (__APPLE_CC__) && (defined (__x86_64__) || defined (__aarch64__)) + #define HOST_ENDIAN 0 + typedef unsigned int uintm; + typedef int intm; diff --git a/patches/0019-Add-aarch64-to-type-definitions-for-m1-compilation-1.patch b/patches/0019-Add-aarch64-to-type-definitions-for-m1-compilation-1.patch deleted file mode 100644 index cc8cfa1..0000000 --- a/patches/0019-Add-aarch64-to-type-definitions-for-m1-compilation-1.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/decompiler/types.h b/src/decompiler/types.h -index d109066..1df425a 100644 ---- a/src/decompiler/types.h -+++ b/src/decompiler/types.h -@@ -166,7 +166,7 @@ typedef char int1; - typedef uint4 uintp; - #endif - --#if defined (__APPLE_CC__) && defined (__x86_64__) -+#if defined (__APPLE_CC__) && (defined (__x86_64__) || defined (__aarch64__)) - #define HOST_ENDIAN 0 - typedef unsigned int uintm; - typedef int intm;