boostorg / python

Boost.org python module
http://boostorg.github.io/python
Boost Software License 1.0
465 stars 201 forks source link

Problem with re-definition of `_DEBUG` in `wrap_python.hpp` #408

Open mont29 opened 1 year ago

mont29 commented 1 year ago

python/include/boost/python/detail/wrap_python.hpp undefines _DEBUG, and then redefines it as an empty macro at the end of the file.

However, this macro is not necessarily empty originally.

This discrepancy of values breaks building debug Blender 3.5 (aka current master) with any official boost library, as TBB (2020 U3) has some complex logic to handle various cases of values for _DEBUG (see include/tbb/tbb_config.h).

One could argue that the TBB 2020 code is also weak (it seems that they changed it in the more recent oneTBB), but it does rely on the value of _DEBUG to stay the same, which imho is a reasonable expectation?.

Not sure how keeping the same value for this debug could be ensured though... Maybe through BOOST_PP_ASSIGN_SLOT?


PS: For now, Blender is patching its own boost to redefine _DEBUG as 1, but this is obviously not a proper solution in general.