blob: 0181be2a1d2f65420e89c400026d290f00900905 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
|