OpenUSD 26.11.1 macro build errors

Hello,

We are currently getting build errors when compiling our project against OpenUSD 26.11.1 with python support. Our build flags are as follows:

c++20, /Gd /MD and /Zc:preprocessor

We are getting the following errors:

1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(239,1): error C2065: ‘op_’: undeclared identifier
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(239,1): error C2059: syntax error: ‘>’
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(239,1): error C2332: ‘struct’: missing tag name
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(239,1): error C3306: ‘pxrInternal_v0_26_11__pxrReserved__::pxr_boost::python::detail::’: unnamed class template is not allowed
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(239,1): error C2913: explicit specialization; ‘pxrInternal_v0_26_11__pxrReserved__::pxr_boost::python::detail::’ is not a specialization of a class template
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(240,1): error C2065: ‘op_’: undeclared identifier
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(240,1): error C2059: syntax error: ‘>’
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(240,1): error C2332: ‘struct’: missing tag name
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(240,1): error C2913: explicit specialization; ‘pxrInternal_v0_26_11__pxrReserved__::pxr_boost::python::detail::’ is not a specialization of a class template
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(241,1): error C2065: ‘op_’: undeclared identifier
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(241,1): error C2059: syntax error: ‘>’
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(241,1): error C2332: ‘struct’: missing tag name
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)
1>D:\Workdir\toolbox\wntx64\OpenUSD_SDK\26.11.1\include\pxr\external\boost\python\operators.hpp(241,1): error C2913: explicit specialization; ‘pxrInternal_v0_26_11__pxrReserved__::pxr_boost::python::detail::’ is not a specialization of a class template
1>(compiling source file ‘../../src/USDUtils/USDScriptingEngine.cpp’)

PXR_BOOST_PYTHON_BINARY_OPERATOR(and, rand, &)
PXR_BOOST_PYTHON_BINARY_OPERATOR(xor, rxor, ^)
PXR_BOOST_PYTHON_BINARY_OPERATOR(or, ror, |)

It appears these macros are trying to use reserved c++ keywords “and”, “xor” and “or” and the stdlib function rand.

Just a guess, but does your code happen #define the names and, or, and xor?