Visual Studio 2012 (and earlier versions) provide predefined #defines so that source code can be #ifdef ed appropriately, see http://msdn.microsoft.com/en-us/library/b0084kay.aspx
I would like to #ifdef some C++ code if it is being compiled (or not) for the Windows 8 Runtime (Component Extenstions for Runtime C++/CX) , i.e. with compiler switch /ZW, see http://msdn.microsoft.com/en-us/library/hh561383.aspx and http://msdn.microsoft.com/en-us/library/xey702bw.aspx
Checking for C++ or CLR compilation is provided by __cplusplus and __cplusplus_cli (or __CLR_VER) respectively, but there doesn’t seem to be a way of #ifdef ing for C++/CX /Zw Windows Runtime compilation!?
Does anyone know a way?
Thanks
The
__cplusplus_winrtmacro is defined when C++/CX support is enabled (i.e., when compiling with /ZW).