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;