summaryrefslogtreecommitdiff
path: root/user/gambit-c/s390.patch
blob: 9580f2e756d9cb18a2f171f8e4e253d908d9bc83 (plain) (blame)
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
35
36
37
38
39
40
41
42
43
44
45
46
diff --git a/include/gambit.h.in b/include/gambit.h.in
index 71e712a7..f8eeb2ea 100644
--- a/include/gambit.h.in
+++ b/include/gambit.h.in
@@ -443,11 +443,27 @@
 #endif
 #endif
 
+#ifndef ___CPU_s390
+
+#ifdef __s390__
+#define ___CPU_s390
+#else
+#ifdef __s390x__
+#define ___CPU_s390
+#else
+#ifdef __zarch__
+#define ___CPU_s390
+#endif
+#endif
+#endif
+
+#endif
+
 /*
  * Determine the byte order endianness based on the processor type.
- * We assume that all processors are little-endian, except the sparc and
- * m68k.  The PowerPC, MIPS, ARM and Itanium can be either big-endian or
- * little-endian so extra tests are needed.
+ * We assume that all processors are little-endian, except the sparc,
+ * m68k, and s390.  The PowerPC, MIPS, ARM and Itanium can be either
+ * big-endian or little-endian so extra tests are needed.
  */
 
 #ifndef ___BIG_ENDIAN
@@ -484,6 +500,10 @@
 #define ___BIG_ENDIAN
 #endif
 
+#ifdef ___CPU_s390
+#define ___BIG_ENDIAN
+#endif
+
 #ifdef ___CPU_mips
 #ifdef _MIPSEL
 #define ___LITTLE_ENDIAN