From 87f6dcae61000df084c6ea0b430fef6982f04708 Mon Sep 17 00:00:00 2001 From: ff <16729017+shelllet@users.noreply.github.com> Date: Fri, 13 Jun 2025 08:27:08 +0800 Subject: [PATCH] Check if the __debug macro has a value and avoid error C1017(invalid integer constant expression) --- include/boost/python/detail/wrap_python.hpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/boost/python/detail/wrap_python.hpp b/include/boost/python/detail/wrap_python.hpp index 037e4bf2ec..0d2ae540b7 100644 --- a/include/boost/python/detail/wrap_python.hpp +++ b/include/boost/python/detail/wrap_python.hpp @@ -21,6 +21,9 @@ // 01 Mar 01 define PyObject_INIT() for Python 1.x (Dave Abrahams) #ifdef _DEBUG +#if _DEBUG +#define _DEBUG_HAS_VALUE +#endif # ifndef BOOST_DEBUG_PYTHON # ifdef _MSC_VER // VC8.0 will complain if system headers are #included both with @@ -206,7 +209,11 @@ typedef int pid_t; #ifdef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H # undef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H +#if defined(_DEBUG_HAS_VALUE) +# define _DEBUG 1 +#else # define _DEBUG +#endif # ifdef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H # undef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H # undef _CRT_NOFORCE_MANIFEST