(C++/WP8)为 WP8 平台定义的平台宏是什么?



我已经知道我使用__cplusplus_winrt宏构建WinRT,但我想进一步区分Windows RT和Windows Phone。我应该检查哪个宏?

在互联网上搜索了相当长一段时间后,我很确定唯一的解决方案是使用项目定义的宏。这不是理想的,但可以完成工作。

<标题> 更新

最近我发现了这些宏:

#if (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP)
//You're in WinRT and it's Windows App
#elif (WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
//It's Windows Phone, but still don't know it's Silverlight Dll or WinRT Dll
#else
//Desktop
#endif

现在我只需要使用项目宏来区分Windows Phone Silverlight和Windows Phone App,我开始相信我不需要^_^

最新更新