File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 5656# include <math.h>
5757# endif
5858
59+ //
60+ // Use the real python debugging library if it is provided.
61+ // Otherwise use the "documented" trick involving checking for _DEBUG
62+ // and undefined that symbol while we include Python headers.
63+ // Update: this method does not fool Microsoft Visual C++ 8 anymore; two
64+ // of its header files (crtdefs.h and use_ansi.h) check if _DEBUG was set
65+ // or not, and set flags accordingly (_CRT_MANIFEST_RETAIL,
66+ // _CRT_MANIFEST_DEBUG, _CRT_MANIFEST_INCONSISTENT). The next time the
67+ // check is performed in the same compilation unit, and the flags are found,
68+ // and error is triggered. Let's prevent that by setting _CRT_NOFORCE_MANIFEST.
69+ //
70+
5971// If PYTHONQT_USE_RELEASE_PYTHON_FALLBACK is enabled, try to link
6072// release Python DLL if it is available by undefining _DEBUG while
6173// including Python.h
6274#if defined(PYTHONQT_USE_RELEASE_PYTHON_FALLBACK ) && defined(_DEBUG )
6375#undef _DEBUG
76+ // Include these low level headers before undefing _DEBUG. Otherwise when doing
77+ // a debug build against a release build of python the compiler will end up
78+ // including these low level headers without DEBUG enabled, causing it to try
79+ // and link release versions of this low level C api.
80+ # include <basetsd.h>
81+ # include <assert.h>
82+ # include <ctype.h>
83+ # include <errno.h>
84+ # include <io.h>
85+ # include <math.h>
86+ # include <sal.h>
87+ # include <stdarg.h>
88+ # include <stddef.h>
89+ # include <stdio.h>
90+ # include <stdlib.h>
91+ # include <string.h>
92+ # include <sys/stat.h>
93+ # include <time.h>
94+ # include <wchar.h>
6495#if defined(_MSC_VER ) && _MSC_VER >= 1400
6596#define _CRT_NOFORCE_MANIFEST 1
6697#define _STL_NOFORCE_MANIFEST 1
You can’t perform that action at this time.
0 commit comments