diff options
author | Olly Betts <olly@survex.com> | 2022-01-27 08:24:05 +1300 |
---|---|---|
committer | Olly Betts <ojwbetts@gmail.com> | 2022-02-03 17:54:50 +1300 |
commit | bede0b407b454c06110145fc2e624fb2468fd91a (patch) | |
tree | 2e214e507c1e0c52569d60ffa0bca174d302680a /Lib/python/pyruntime.swg | |
parent | 5691f3f685e0bfc8d5749387bca5815c8e69de27 (diff) | |
download | swig-bede0b407b454c06110145fc2e624fb2468fd91a.tar.gz |
[python] Workaround MSVC2022-related bug
Fixes #2090
Diffstat (limited to 'Lib/python/pyruntime.swg')
-rw-r--r-- | Lib/python/pyruntime.swg | 7 |
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 |