mingw-w64-tools/mingw-w64-tools-2.0.999-s390.patch
2019-06-04 17:14:01 +02:00

64 lines
2.2 KiB
Diff

diff -rupN mingw-w64-v6.0.0/mingw-w64-tools/widl/include/basetsd.h mingw-w64-v6.0.0-new/mingw-w64-tools/widl/include/basetsd.h
--- mingw-w64-v6.0.0/mingw-w64-tools/widl/include/basetsd.h 2018-09-14 16:16:43.000000000 +0200
+++ mingw-w64-v6.0.0-new/mingw-w64-tools/widl/include/basetsd.h 2019-05-07 17:55:56.077196349 +0200
@@ -36,7 +36,7 @@ extern "C" {
* 64-bit.
*/
-#if (defined(__x86_64__) || defined(__powerpc64__) || defined(__aarch64__)) && !defined(_WIN64)
+#if (defined(__x86_64__) || defined(__powerpc64__) || defined(__aarch64__) || defined(__s390x__)) && !defined(_WIN64)
#define _WIN64
#endif
@@ -309,6 +309,10 @@ typedef ULONG_PTR KAFFINITY, *PKAFFINITY
# undef WORDS_BIGENDIAN
# undef BITFIELDS_BIGENDIAN
# undef ALLOW_UNALIGNED_ACCESS
+#elif defined(__s390__)
+# define WORDS_BIGENDIAN
+# define BITFIELDS_BIGENDIAN
+# define ALLOW_UNALIGNED_ACCESS
#elif !defined(RC_INVOKED) && !defined(__WIDL__) && !defined(__midl)
# error Unknown CPU architecture!
#endif
diff -rupN mingw-w64-v6.0.0/mingw-w64-tools/widl/include/winnt.h mingw-w64-v6.0.0-new/mingw-w64-tools/widl/include/winnt.h
--- mingw-w64-v6.0.0/mingw-w64-tools/widl/include/winnt.h 2018-09-14 16:16:43.000000000 +0200
+++ mingw-w64-v6.0.0-new/mingw-w64-tools/widl/include/winnt.h 2019-05-07 17:55:56.078196338 +0200
@@ -2108,6 +2108,36 @@ typedef struct _STACK_FRAME_HEADER
#endif /* __powerpc__ */
+#ifdef __s390__
+
+/*
+ * FIXME:
+ *
+ * There is no official CONTEXT structure defined for the S/390
+ * architecture, so I just made one up.
+ *
+ * This structure is completely dummy, made just to build widl.
+ *
+ */
+
+#define CONTEXT_S390 0x10000000
+
+#define CONTEXT_CONTROL (CONTEXT_S390 | 0x00000001)
+#define CONTEXT_FLOATING_POINT (CONTEXT_S390 | 0x00000002)
+#define CONTEXT_INTEGER (CONTEXT_S390 | 0x00000004)
+
+#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
+
+#define EXCEPTION_READ_FAULT 0
+#define EXCEPTION_WRITE_FAULT 1
+#define EXCEPTION_EXECUTE_FAULT 8
+
+typedef struct _CONTEXT
+{
+} CONTEXT;
+
+#endif /* __s390__ */
+
#if !defined(CONTEXT_FULL) && !defined(RC_INVOKED)
#error You need to define a CONTEXT for your CPU
#endif