Following these related questions (1,2,3), I'm trying to get OS information from the preprocessor as follows:
#include <boost/preprocessor/stringize.hpp>
#ifdef __MACH__
#pragma message ("MACH: " BOOST_PP_STRINGIZE(__MACH__) )
#endif
clang 13.1.6 prints:
warning: MACH: 1 [-W#pragma-messages]
#pragma message ("MACH: " BOOST_PP_STRINGIZE(__MACH__) )
and gcc 11.3.0 :
note: '#pragma message: MACH: 1'
4 | #pragma message ("MACH: " BOOST_PP_STRINGIZE(__MACH__) )
This tells me that the macro __MACH__
is defined, but I don't get details about the OS version.
I want to print the version of the operating system or print all the macros that are defined using the preprocessor.