
Hello, I have the following macro code: #define PY_DEFINE_CONSTANT(X) scope().attr(#X) = X #define PY_DEFINE_CONSTANTS_HELPER(R, DATA, X) PY_DEFINE_CONSTANT(X); #define PY_DEFINE_CONSTANTS(SEQ) \ BOOST_PP_SEQ_FOR_EACH(PY_DEFINE_CONSTANTS_HELPER, BOOST_PP_EMPTY, SEQ) This works fine when used with non-macro arguments: PY_DEFINE_CONSTANTS((foo)(bar)) expands to: scope().attr("foo") = foo; scope().attr("bar") = bar; But when foo and bar are macros like this: #define foo 1 #define bar 2 it expands to: scope().attr("1") = 1; scope().attr("2") = 2; Is there a way to get this: scope().attr("foo") = 1; scope().attr("bar") = 2; or this: scope().attr("foo") = foo; scope().attr("bar") = bar; IOW, how can I prevent macro expansion for X when invoked from PY_DEFINE_CONSTANTS()? TIA, Markus