From 129591cb52598696e65d9a8b5be72a6d78f1df0d Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 22 Jul 2015 23:26:08 +0300 Subject: [PATCH] Utils: Add constexpr to most functions in HostOsInfo Change-Id: If45cc91e0ae4061e01e3540e1867b08bffbe5774 Reviewed-by: Daniel Teske Reviewed-by: Orgad Shaneh --- src/libs/utils/hostosinfo.h | 14 +++++++------- 1 file 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;