Utils: Move C++ language details from ProjectExplorer to Utils

We want to use them in the backend processes too so it's nice to share them
in Utils. A concrete size was added too because they should be serialized.

Change-Id: Id5eb8f46643d5159f034fc9559f68a08d7e5847a
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Marco Bubke
2019-01-09 18:31:20 +01:00
parent e5558cd0c5
commit 5dbaf387ba
29 changed files with 104 additions and 98 deletions

View File

@@ -297,8 +297,9 @@ static long toLanguageVersionAsLong(QByteArray dateAsByteArray)
return result;
}
LanguageVersion ToolChain::cxxLanguageVersion(const QByteArray &cplusplusMacroValue)
Utils::LanguageVersion ToolChain::cxxLanguageVersion(const QByteArray &cplusplusMacroValue)
{
using Utils::LanguageVersion;
const long version = toLanguageVersionAsLong(cplusplusMacroValue);
if (version > 201703L)
@@ -313,8 +314,10 @@ LanguageVersion ToolChain::cxxLanguageVersion(const QByteArray &cplusplusMacroVa
return LanguageVersion::CXX03;
}
LanguageVersion ToolChain::languageVersion(const Core::Id &language, const Macros &macros)
Utils::LanguageVersion ToolChain::languageVersion(const Core::Id &language, const Macros &macros)
{
using Utils::LanguageVersion;
if (language == Constants::CXX_LANGUAGE_ID) {
for (const ProjectExplorer::Macro &macro : macros) {
if (macro.key == "__cplusplus") // Check for the C++ identifying macro