We have a C++ library, and we received a few requests to support UWP. I'm investigating the port now. I'm looking through Microsoft's C/C++ Preprocessor Reference | Predefined Macros for Visual Studio 2015, but I don't see anything related to UWP.
I found How to: Use Existing C++ Code in a Universal Windows Platform App, but they look like the old defines for those Metro UI apps:
WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PC_APP)
WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
I'd expect to see something specific to the latest iteration of the Windows Runtime. I thought we might be able to detect Windows 10 and UWP via _WIN32_WINNT_WIN10
, but there does not appears such a macro if I am parsing Using the Windows Headers from MSDN correctly.
Also some APIs are only available for Windows 10 and UWP Windows Store apps, so we need to detect when some APIs are missing (i.e., Windows Phone 8, Windows Store 8, Windows 10, and Windows Store 10).
What are the preprocessor macros used to detect UWP?
A related question may be Detect Windows Kit 8.0 and Windows Kit 8.1 SDKs, but I'm not sure at the moment.