forked from qt-creator/qt-creator
Compile fix for HostInfo on Linux
Change-Id: I77924e1025baef92ebcff42ce683dbf9d8feb162 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -31,11 +31,13 @@
|
|||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
HostOsInfo::HostArchitecture HostOsInfo::hostArchitecture()
|
HostOsInfo::HostArchitecture HostOsInfo::hostArchitecture()
|
||||||
{
|
{
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
SYSTEM_INFO info;
|
SYSTEM_INFO info;
|
||||||
GetNativeSystemInfo(&info);
|
GetNativeSystemInfo(&info);
|
||||||
switch (info.wProcessorArchitecture) {
|
switch (info.wProcessorArchitecture) {
|
||||||
@@ -50,5 +52,7 @@ HostOsInfo::HostArchitecture HostOsInfo::hostArchitecture()
|
|||||||
default:
|
default:
|
||||||
return HostOsInfo::HostArchitectureOther;
|
return HostOsInfo::HostArchitectureOther;
|
||||||
}
|
}
|
||||||
}
|
#else
|
||||||
|
return HostOsInfo::HostArchitectureUnknown;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
@@ -49,11 +49,9 @@ public:
|
|||||||
enum HostOs { HostOsWindows, HostOsLinux, HostOsMac, HostOsOtherUnix, HostOsOther };
|
enum HostOs { HostOsWindows, HostOsLinux, HostOsMac, HostOsOtherUnix, HostOsOther };
|
||||||
static inline HostOs hostOs();
|
static inline HostOs hostOs();
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
|
||||||
enum HostArchitecture { HostArchitectureX86, HostArchitectureAMD64, HostArchitectureItanium,
|
enum HostArchitecture { HostArchitectureX86, HostArchitectureAMD64, HostArchitectureItanium,
|
||||||
HostArchitectureArm, HostArchitectureOther };
|
HostArchitectureArm, HostArchitectureUnknown };
|
||||||
static HostArchitecture hostArchitecture();
|
static HostArchitecture hostArchitecture();
|
||||||
#endif
|
|
||||||
|
|
||||||
static bool isWindowsHost() { return hostOs() == HostOsWindows; }
|
static bool isWindowsHost() { return hostOs() == HostOsWindows; }
|
||||||
static bool isLinuxHost() { return hostOs() == HostOsLinux; }
|
static bool isLinuxHost() { return hostOs() == HostOsLinux; }
|
||||||
|
Reference in New Issue
Block a user