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 #9

Thanks @Neosettler for testing the patch.

Reported-by: Neosettler
  • Loading branch information
jcfr committed May 28, 2013
1 parent 15839e0 commit 9c92fd2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 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>
#endif

#include <Python.h>

#ifdef PYTHONQT_UNDEF_DEBUG
# define _DEBUG
#else
# include <Python.h>
#endif

/*
Expand Down

0 comments on commit 9c92fd2

Please sign in to comment.