Compile fix for HostInfo on Linux

Change-Id: I77924e1025baef92ebcff42ce683dbf9d8feb162
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
hjk
2013-01-17 11:56:39 +01:00
committed by Daniel Teske
parent 4ec62609ed
commit a08b1ef853
2 changed files with 6 additions and 4 deletions

View File

@@ -31,11 +31,13 @@
#ifdef Q_OS_WIN
#include <windows.h>
#endif
using namespace Utils;
HostOsInfo::HostArchitecture HostOsInfo::hostArchitecture()
{
#ifdef Q_OS_WIN
SYSTEM_INFO info;
GetNativeSystemInfo(&info);
switch (info.wProcessorArchitecture) {
@@ -50,5 +52,7 @@ HostOsInfo::HostArchitecture HostOsInfo::hostArchitecture()
default:
return HostOsInfo::HostArchitectureOther;
}
}
#else
return HostOsInfo::HostArchitectureUnknown;
#endif
}

View File

@@ -49,11 +49,9 @@ public:
enum HostOs { HostOsWindows, HostOsLinux, HostOsMac, HostOsOtherUnix, HostOsOther };
static inline HostOs hostOs();
#ifdef Q_OS_WIN
enum HostArchitecture { HostArchitectureX86, HostArchitectureAMD64, HostArchitectureItanium,
HostArchitectureArm, HostArchitectureOther };
HostArchitectureArm, HostArchitectureUnknown };
static HostArchitecture hostArchitecture();
#endif
static bool isWindowsHost() { return hostOs() == HostOsWindows; }
static bool isLinuxHost() { return hostOs() == HostOsLinux; }