Skip to content

Commit

Permalink
Fix "_invalid_parameter_noinfo_noreturn" link error
Browse files Browse the repository at this point in the history
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 commontk#9
  • Loading branch information
jcfr committed May 27, 2013
1 parent 15839e0 commit f731625
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/PythonQtPythonInclude.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
// release Python DLL if it is available by undefining _DEBUG while
// including Python.h
#if defined(PYTHONQT_USE_RELEASE_PYTHON_FALLBACK) && defined(_DEBUG)
# undef _DEBUG
# define PYTHONQT_UNDEF_DEBUG
// Include these low level headers before undefing _DEBUG. Otherwise when doing
// a debug build against a release build of python the compiler will end up
// including these low level headers without DEBUG enabled, causing it to try
Expand All @@ -83,14 +83,17 @@
# include <sys/stat.h>
# include <time.h>
# include <wchar.h>
# undef _DEBUG
# if defined(_MSC_VER) && _MSC_VER >= 1400
# define _CRT_NOFORCE_MANIFEST 1
# define _STL_NOFORCE_MANIFEST 1
# endif
# include <Python.h>
# define _DEBUG
#else
# include <Python.h>
#endif

#include <Python.h>

#ifdef PYTHONQT_UNDEF_DEBUG
# undef _DEBUG
#endif

/*
Expand Down

0 comments on commit f731625

Please sign in to comment.