diff options
-rw-r--r-- | Lib/python/pyruntime.swg | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Lib/python/pyruntime.swg b/Lib/python/pyruntime.swg index 74669a74f..eabc829c0 100644 --- a/Lib/python/pyruntime.swg +++ b/Lib/python/pyruntime.swg @@ -4,13 +4,6 @@ # 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 - #ifndef SWIG_NO_PY_SSIZE_T_CLEAN #define PY_SSIZE_T_CLEAN #endif @@ -24,6 +17,14 @@ #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) /* Use debug wrappers with the Python release dll */ + +#if defined(_MSC_VER) && _MSC_VER >= 1929 +/* 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 + # undef _DEBUG # include <Python.h> # define _DEBUG 1 |