aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/hostosinfo.h
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2016-09-15 09:53:02 +0200
committerEike Ziller <eike.ziller@qt.io>2016-09-15 09:21:15 +0000
commit32468cf0ecbf8e14a5aa767980bcab88e59ffdba (patch)
treefe743b211b83d5d4d87d199ff87b80d889ce651d /src/libs/utils/hostosinfo.h
parent022120658d7585c36163848c745f52670510d9c6 (diff)
Fix build with MSVC 2015 Update 2
Complains about the constexpr otherwise. Change-Id: Idb64ed3287b8f9506a811a091dd1ad8ae11b2ad8 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/utils/hostosinfo.h')
-rw-r--r--src/libs/utils/hostosinfo.h49
1 files changed, 22 insertions, 27 deletions
diff --git a/src/libs/utils/hostosinfo.h b/src/libs/utils/hostosinfo.h
index 5d5f3909711..70f01f8f5d9 100644
--- a/src/libs/utils/hostosinfo.h
+++ b/src/libs/utils/hostosinfo.h
@@ -42,7 +42,20 @@ namespace Utils {
class QTCREATOR_UTILS_EXPORT HostOsInfo
{
public:
- static constexpr inline OsType hostOs();
+ static constexpr inline OsType hostOs()
+ {
+#if defined(Q_OS_WIN)
+ return OsTypeWindows;
+#elif defined(Q_OS_LINUX)
+ return OsTypeLinux;
+#elif defined(Q_OS_MAC)
+ return OsTypeMac;
+#elif defined(Q_OS_UNIX)
+ return OsTypeOtherUnix;
+#else
+ return OsTypeOther;
+#endif
+ }
enum HostArchitecture { HostArchitectureX86, HostArchitectureAMD64, HostArchitectureItanium,
HostArchitectureArm, HostArchitectureUnknown };
@@ -51,7 +64,14 @@ public:
static constexpr bool isWindowsHost() { return hostOs() == OsTypeWindows; }
static constexpr bool isLinuxHost() { return hostOs() == OsTypeLinux; }
static constexpr bool isMacHost() { return hostOs() == OsTypeMac; }
- static constexpr inline bool isAnyUnixHost();
+ static constexpr inline bool isAnyUnixHost()
+ {
+#ifdef Q_OS_UNIX
+ return true;
+#else
+ return false;
+#endif
+ }
static QString withExecutableSuffix(const QString &executable)
{
@@ -87,29 +107,4 @@ private:
static bool m_useOverrideFileNameCaseSensitivity;
};
-
-constexpr OsType HostOsInfo::hostOs()
-{
-#if defined(Q_OS_WIN)
- return OsTypeWindows;
-#elif defined(Q_OS_LINUX)
- return OsTypeLinux;
-#elif defined(Q_OS_MAC)
- return OsTypeMac;
-#elif defined(Q_OS_UNIX)
- return OsTypeOtherUnix;
-#else
- return OsTypeOther;
-#endif
-}
-
-constexpr bool HostOsInfo::isAnyUnixHost()
-{
-#ifdef Q_OS_UNIX
- return true;
-#else
- return false;
-#endif
-}
-
} // namespace Utils