Skip to content

Commit 56cdf6c

Browse files
committed
Fix "_invalid_parameter_noinfo_noreturn" link error
By ensuring that "undef" of _DEBUG macro is not done before system includes, it fixes the issue. This commit is based on what has been within VTK. See Kitware/VTK@81d4a72 See #9
1 parent 15839e0 commit 56cdf6c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/PythonQtPythonInclude.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
// release Python DLL if it is available by undefining _DEBUG while
6464
// including Python.h
6565
#if defined(PYTHONQT_USE_RELEASE_PYTHON_FALLBACK) && defined(_DEBUG)
66-
# undef _DEBUG
66+
# define PYTHONQT_UNDEF_DEBUG
6767
// Include these low level headers before undefing _DEBUG. Otherwise when doing
6868
// a debug build against a release build of python the compiler will end up
6969
// including these low level headers without DEBUG enabled, causing it to try
@@ -83,14 +83,17 @@
8383
# include <sys/stat.h>
8484
# include <time.h>
8585
# include <wchar.h>
86+
# undef _DEBUG
8687
# if defined(_MSC_VER) && _MSC_VER >= 1400
8788
# define _CRT_NOFORCE_MANIFEST 1
8889
# define _STL_NOFORCE_MANIFEST 1
8990
# endif
90-
# include <Python.h>
91+
#endif
92+
93+
#include <Python.h>
94+
95+
#ifdef PYTHONQT_UNDEF_DEBUG
9196
# define _DEBUG
92-
#else
93-
# include <Python.h>
9497
#endif
9598

9699
/*

0 commit comments

Comments
 (0)