Files
MINGW-packages/mingw-w64-python/0100-mmapmodule-define-DONT_USE_SEH.patch
2026-01-07 22:17:09 +01:00

29 lines
779 B
Diff

From e39e0ebdf470416f51c37716fbb6b3fa9a8dc435 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Sat, 3 Jan 2026 16:39:43 +0100
Subject: [PATCH 100/N] mmapmodule: define DONT_USE_SEH
copy the logic from callproc.c
---
Modules/mmapmodule.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 0e1a709..c6c1978 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -62,6 +62,13 @@ my_getallocationgranularity (void)
#endif
+#if defined(_DEBUG) || defined(__MINGW32__)
+/* Don't use structured exception handling on Windows if this is defined.
+ MingW, AFAIK, doesn't support it.
+*/
+#define DONT_USE_SEH
+#endif
+
#ifdef UNIX
#include <sys/mman.h>
#include <sys/stat.h>