winrt: workaround for pre-UWP builds.

There's probably a better way to do this for legacy platforms, though.
Ryan C. Gordon 2017-12-31 03:36:54 -05:00
parent 140cc46004
commit 027d63bc01
1 changed files with 2 additions and 0 deletions

View File

@ -45,6 +45,7 @@ SDL_WinRTRunApp(int (*mainFunction)(int, char **), void * xamlBackgroundPanel)
extern "C" DECLSPEC SDL_WinRT_DeviceFamily extern "C" DECLSPEC SDL_WinRT_DeviceFamily
SDL_WinRTGetDeviceFamily() SDL_WinRTGetDeviceFamily()
{ {
#if NTDDI_VERSION >= NTDDI_WIN10 /* !!! FIXME: I have no idea if this is the right test. This is a UWP API, I think. Older windows should...just return "mobile"? I don't know. --ryan. */
Platform::String^ deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily; Platform::String^ deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily;
if (deviceFamily->Equals("Windows.Desktop")) if (deviceFamily->Equals("Windows.Desktop"))
@ -59,6 +60,7 @@ SDL_WinRTGetDeviceFamily()
{ {
return SDL_WINRT_DEVICEFAMILY_XBOX; return SDL_WINRT_DEVICEFAMILY_XBOX;
} }
#endif
return SDL_WINRT_DEVICEFAMILY_UNKNOWN; return SDL_WINRT_DEVICEFAMILY_UNKNOWN;
} }