aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/hostosinfo.h
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-07-22 23:26:08 +0300
committerOrgad Shaneh <orgads@gmail.com>2016-09-14 10:50:29 +0000
commit129591cb52598696e65d9a8b5be72a6d78f1df0d (patch)
tree1c6f5eed0ddc700179864d6277117604d3b43142 /src/libs/utils/hostosinfo.h
parent074b61c3a7752700867d7cb1738d16848f87abe9 (diff)
Utils: Add constexpr to most functions in HostOsInfo
Change-Id: If45cc91e0ae4061e01e3540e1867b08bffbe5774 Reviewed-by: Daniel Teske <qt@squorn.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/libs/utils/hostosinfo.h')
-rw-r--r--src/libs/utils/hostosinfo.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libs/utils/hostosinfo.h b/src/libs/utils/hostosinfo.h
index 72327a5c400..5d5f3909711 100644
--- a/src/libs/utils/hostosinfo.h
+++ b/src/libs/utils/hostosinfo.h
@@ -42,16 +42,16 @@ namespace Utils {
class QTCREATOR_UTILS_EXPORT HostOsInfo
{
public:
- static inline OsType hostOs();
+ static constexpr inline OsType hostOs();
enum HostArchitecture { HostArchitectureX86, HostArchitectureAMD64, HostArchitectureItanium,
HostArchitectureArm, HostArchitectureUnknown };
static HostArchitecture hostArchitecture();
- static bool isWindowsHost() { return hostOs() == OsTypeWindows; }
- static bool isLinuxHost() { return hostOs() == OsTypeLinux; }
- static bool isMacHost() { return hostOs() == OsTypeMac; }
- static inline bool isAnyUnixHost();
+ 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 QString withExecutableSuffix(const QString &executable)
{
@@ -88,7 +88,7 @@ private:
};
-OsType HostOsInfo::hostOs()
+constexpr OsType HostOsInfo::hostOs()
{
#if defined(Q_OS_WIN)
return OsTypeWindows;
@@ -103,7 +103,7 @@ OsType HostOsInfo::hostOs()
#endif
}
-bool HostOsInfo::isAnyUnixHost()
+constexpr bool HostOsInfo::isAnyUnixHost()
{
#ifdef Q_OS_UNIX
return true;