summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2022-01-27 08:24:05 +1300
committerOlly Betts <ojwbetts@gmail.com>2022-02-03 17:54:50 +1300
commitbede0b407b454c06110145fc2e624fb2468fd91a (patch)
tree2e214e507c1e0c52569d60ffa0bca174d302680a
parent5691f3f685e0bfc8d5749387bca5815c8e69de27 (diff)
downloadswig-bede0b407b454c06110145fc2e624fb2468fd91a.tar.gz
[python] Workaround MSVC2022-related bug
Fixes #2090
-rw-r--r--Lib/python/pyruntime.swg7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/python/pyruntime.swg b/Lib/python/pyruntime.swg
index 751bc8d5f..843fa6ce1 100644
--- a/Lib/python/pyruntime.swg
+++ b/Lib/python/pyruntime.swg
@@ -4,6 +4,13 @@
# include <math.h>
#endif
+#if defined(_MSC_VER) && _MSC_VER >= 1930
+/* Workaround what seems to be a bug in the Python headers with MSVC 2022.
+ * https://github.com/swig/swig/issues/2090
+ */
+# include <corecrt.h>
+#endif
+
#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
/* Use debug wrappers with the Python release dll */
# undef _DEBUG