mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Fix Windows architecture reporting in sysinfo
This commit is contained in:
parent
da832a295e
commit
a292cc42aa
@ -204,7 +204,6 @@ bool detectMSVCBuildDir(const std::string &path)
|
|||||||
std::string get_sysinfo()
|
std::string get_sysinfo()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
LPSTR filePath = new char[MAX_PATH];
|
LPSTR filePath = new char[MAX_PATH];
|
||||||
UINT blockSize;
|
UINT blockSize;
|
||||||
@ -224,15 +223,25 @@ std::string get_sysinfo()
|
|||||||
<< LOWORD(fixedFileInfo->dwProductVersionMS) << '.' // Minor
|
<< LOWORD(fixedFileInfo->dwProductVersionMS) << '.' // Minor
|
||||||
<< HIWORD(fixedFileInfo->dwProductVersionLS) << ' '; // Build
|
<< HIWORD(fixedFileInfo->dwProductVersionLS) << ' '; // Build
|
||||||
|
|
||||||
#ifdef _WIN64
|
SYSTEM_INFO info;
|
||||||
|
GetNativeSystemInfo(&info);
|
||||||
|
switch (info.wProcessorArchitecture) {
|
||||||
|
case PROCESSOR_ARCHITECTURE_AMD64:
|
||||||
oss << "x86_64";
|
oss << "x86_64";
|
||||||
#else
|
break;
|
||||||
BOOL is64 = FALSE;
|
case PROCESSOR_ARCHITECTURE_ARM:
|
||||||
if (IsWow64Process(GetCurrentProcess(), &is64) && is64)
|
oss << "arm";
|
||||||
oss << "x86_64"; // 32-bit app on 64-bit OS
|
break;
|
||||||
else
|
case PROCESSOR_ARCHITECTURE_ARM64:
|
||||||
|
oss << "arm64";
|
||||||
|
break;
|
||||||
|
case PROCESSOR_ARCHITECTURE_INTEL:
|
||||||
oss << "x86";
|
oss << "x86";
|
||||||
#endif
|
break;
|
||||||
|
default:
|
||||||
|
oss << "unknown";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
delete[] lpVersionInfo;
|
delete[] lpVersionInfo;
|
||||||
delete[] filePath;
|
delete[] filePath;
|
||||||
|
Loading…
Reference in New Issue
Block a user