forked from qt-creator/qt-creator
Utils: Avoid multiple calls to GetNativeSystemInfo on Windows
In fact, hostArchitecture is only called on MSVC auto-detection, which is only done on startup. On the other hand, all the other functions in HostOsInfo are independent on external calls, so adapt this one in case it is used in the future. Change-Id: I4646d87cb3b976e358276482cad1b14bfc430964 Reviewed-by: hjk <hjk@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
9bcb933008
commit
adf3a4363f
@@ -38,12 +38,20 @@
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
static WORD hostProcessorArchitecture()
|
||||
{
|
||||
SYSTEM_INFO info;
|
||||
GetNativeSystemInfo(&info);
|
||||
return info.wProcessorArchitecture;
|
||||
}
|
||||
#endif
|
||||
|
||||
HostOsInfo::HostArchitecture HostOsInfo::hostArchitecture()
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
SYSTEM_INFO info;
|
||||
GetNativeSystemInfo(&info);
|
||||
switch (info.wProcessorArchitecture) {
|
||||
static const WORD processorArchitecture = hostProcessorArchitecture();
|
||||
switch (processorArchitecture) {
|
||||
case PROCESSOR_ARCHITECTURE_AMD64:
|
||||
return HostOsInfo::HostArchitectureAMD64;
|
||||
case PROCESSOR_ARCHITECTURE_INTEL:
|
||||
|
Reference in New Issue
Block a user