Skip to content

Commit 87f6dca

Browse files
committed
Check if the __debug macro has a value and avoid error C1017(invalid integer constant expression)
1 parent f604eb8 commit 87f6dca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/boost/python/detail/wrap_python.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
// 01 Mar 01 define PyObject_INIT() for Python 1.x (Dave Abrahams)
2222

2323
#ifdef _DEBUG
24+
#if _DEBUG
25+
#define _DEBUG_HAS_VALUE
26+
#endif
2427
# ifndef BOOST_DEBUG_PYTHON
2528
# ifdef _MSC_VER
2629
// VC8.0 will complain if system headers are #included both with
@@ -206,7 +209,11 @@ typedef int pid_t;
206209

207210
#ifdef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
208211
# undef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
212+
#if defined(_DEBUG_HAS_VALUE)
213+
# define _DEBUG 1
214+
#else
209215
# define _DEBUG
216+
#endif
210217
# ifdef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H
211218
# undef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H
212219
# undef _CRT_NOFORCE_MANIFEST

0 commit comments

Comments
 (0)