aboutsummaryrefslogtreecommitdiffstats
path: root/community/dynamips/detect-byte-order.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/dynamips/detect-byte-order.patch')
-rw-r--r--community/dynamips/detect-byte-order.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/community/dynamips/detect-byte-order.patch b/community/dynamips/detect-byte-order.patch
new file mode 100644
index 0000000000..0181be2a1d
--- /dev/null
+++ b/community/dynamips/detect-byte-order.patch
@@ -0,0 +1,34 @@
+--- a/common/dynamips_common.h
++++ b/common/dynamips_common.h
+@@ -50,21 +50,17 @@
+ #define ARCH_BIG_ENDIAN 0x4321
+ #define ARCH_LITTLE_ENDIAN 0x1234
+
+-#if defined(PPC) || defined(__powerpc__) || defined(__ppc__)
+-#define ARCH_BYTE_ORDER ARCH_BIG_ENDIAN
+-#elif defined(__sparc) || defined(__sparc__)
+-#define ARCH_BYTE_ORDER ARCH_BIG_ENDIAN
+-#elif defined(__alpha) || defined(__alpha__)
+-#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
+-#elif defined(__i386) || defined(__i386__) || defined(i386)
+-#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
++
++#ifdef __BYTE_ORDER__
++#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++#define ARCH_BYTE_ORDER ARCH_BIG_ENDIAN
++#else
++#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
++#endif
++#endif
++
++#if defined(__i386) || defined(__i386__) || defined(i386)
+ #define ARCH_REGPARM_SUPPORTED 1
+-#elif defined(__x86_64__)
+-#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
+-#elif defined(__ia64__)
+-#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
+-#elif defined(__arm__) || defined (__aarch64__)
+-#define ARCH_BYTE_ORDER ARCH_LITTLE_ENDIAN
+ #endif
+
+ #ifndef ARCH_BYTE_ORDER