Boost.Predef macros (e.g. BOOST_OS_WINDOWS) expand to BOOST_VERSION_NUMBER_AVAILABLE instead of 1 or 0. Why is that?
By expanding to BOOST_VERSION_NUMBER_AVAILABLE I can't use these macros in Boost.PP. For instance, I recently had to use code like:
BOOST_PP_IF(
BOOST_OS_UNIX,
lua_pushcfunction(L, tcp_socket_assign),
lua_pushcfunction(L, throw_enosys));
But it failed to compile because BOOST_OS_UNIX doesn't expand to 1 or 0. Instead, it expands to a complex expression that can't be used in preprocessor metaprogramming.
Could we offer BOOST_OS_UNIX10 (and the equivalent to other macros as well) that expand to 1 or 0 instead of a complex expression? Or, alternatively, modify these macros to expand to 1 or 0 already?
Boost.Predef macros (e.g.
BOOST_OS_WINDOWS) expand toBOOST_VERSION_NUMBER_AVAILABLEinstead of1or0. Why is that?By expanding to
BOOST_VERSION_NUMBER_AVAILABLEI can't use these macros in Boost.PP. For instance, I recently had to use code like:But it failed to compile because
BOOST_OS_UNIXdoesn't expand to1or0. Instead, it expands to a complex expression that can't be used in preprocessor metaprogramming.Could we offer
BOOST_OS_UNIX10(and the equivalent to other macros as well) that expand to 1 or 0 instead of a complex expression? Or, alternatively, modify these macros to expand to1or0already?