mirror of https://github.com/encounter/SDL.git
winrt: EffectiveLocation still needs an ifdef, IsApiContractPresent is for runtime
This commit is contained in:
parent
bfffa275ef
commit
169cfe5a7c
|
@ -48,12 +48,16 @@ SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType)
|
||||||
{
|
{
|
||||||
static wstring path;
|
static wstring path;
|
||||||
if (path.empty()) {
|
if (path.empty()) {
|
||||||
|
#if (NTDDI_VERSION >= NTDDI_WIN10_19H1) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP) /* Only PC supports mods */
|
||||||
/* Windows 1903 supports mods, via the EffectiveLocation API */
|
/* Windows 1903 supports mods, via the EffectiveLocation API */
|
||||||
if (Windows::Foundation::Metadata::ApiInformation::IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8, 0)) {
|
if (Windows::Foundation::Metadata::ApiInformation::IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8, 0)) {
|
||||||
path = Windows::ApplicationModel::Package::Current->EffectiveLocation->Path->Data();
|
path = Windows::ApplicationModel::Package::Current->EffectiveLocation->Path->Data();
|
||||||
} else {
|
} else {
|
||||||
path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data();
|
path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
path = Windows::ApplicationModel::Package::Current->InstalledLocation->Path->Data();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return path.c_str();
|
return path.c_str();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue