mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix GetWindowsSystemArchitecture()
According to https://docs.microsoft.com/en-US/windows/desktop/api/sysinfoapi/ns-sysinfoapi-_system_info, sysinfo.wProcessorArchitecture is not a bitset, the current code returns x64 on anything not x86.
This commit is contained in:
parent
5072584781
commit
beb8e72f8f
1 changed files with 9 additions and 6 deletions
|
@ -125,15 +125,18 @@ std::string GetWindowsSystemArchitecture() {
|
|||
ZeroMemory(&sysinfo, sizeof(SYSTEM_INFO));
|
||||
GetNativeSystemInfo(&sysinfo);
|
||||
|
||||
if (sysinfo.wProcessorArchitecture & PROCESSOR_ARCHITECTURE_AMD64)
|
||||
return "(x64)";
|
||||
// Need to check for equality here, since ANDing with 0 is always 0.
|
||||
else if (sysinfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
|
||||
switch (sysinfo.wProcessorArchitecture) {
|
||||
case PROCESSOR_ARCHITECTURE_INTEL:
|
||||
return "(x86)";
|
||||
else if (sysinfo.wProcessorArchitecture & PROCESSOR_ARCHITECTURE_ARM)
|
||||
case PROCESSOR_ARCHITECTURE_AMD64:
|
||||
return "(x64)";
|
||||
case PROCESSOR_ARCHITECTURE_ARM:
|
||||
return "(ARM)";
|
||||
else
|
||||
case PROCESSOR_ARCHITECTURE_ARM64:
|
||||
return "(ARM64)";
|
||||
default:
|
||||
return "(Unknown)";
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue