diff options
Diffstat (limited to 'src/linguist/lupdate/lupdatepreprocessoraction.h')
-rw-r--r-- | src/linguist/lupdate/lupdatepreprocessoraction.h | 65 |
1 files changed, 26 insertions, 39 deletions
diff --git a/src/linguist/lupdate/lupdatepreprocessoraction.h b/src/linguist/lupdate/lupdatepreprocessoraction.h index 0f07a8d6f..f373248b3 100644 --- a/src/linguist/lupdate/lupdatepreprocessoraction.h +++ b/src/linguist/lupdate/lupdatepreprocessoraction.h @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Linguist of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #ifndef LUPDATEPREPROCESSORACTION_H #define LUPDATEPREPROCESSORACTION_H @@ -32,13 +7,12 @@ #include "cpp_clang.h" #include "synchronized.h" -#if defined(Q_CC_MSVC) -# pragma warning(push) -# pragma warning(disable: 4100) -# pragma warning(disable: 4146) -# pragma warning(disable: 4267) -# pragma warning(disable: 4624) -#endif +QT_WARNING_PUSH +QT_WARNING_DISABLE_MSVC(4100) +QT_WARNING_DISABLE_MSVC(4146) +QT_WARNING_DISABLE_MSVC(4267) +QT_WARNING_DISABLE_MSVC(4624) +QT_WARNING_DISABLE_GCC("-Wnonnull") #include <clang/Frontend/CompilerInstance.h> #include <clang/Frontend/FrontendActions.h> @@ -46,9 +20,7 @@ #include <clang/Lex/PPCallbacks.h> #include <clang/Lex/Preprocessor.h> -#if defined(Q_CC_MSVC) -# pragma warning(pop) -#endif +QT_WARNING_POP #include <memory> @@ -62,7 +34,7 @@ public: , m_stores(stores) { const auto &sm = m_preprocessor.getSourceManager(); - m_inputFile = sm.getFileEntryForID(sm.getMainFileID())->getName(); + m_inputFile = sm.getFileEntryRefForID(sm.getMainFileID())->getName(); } ~LupdatePPCallbacks() override @@ -76,7 +48,22 @@ private: void storeMacroArguments(const std::vector<QString> &args, TranslationRelatedStore *store); - void SourceRangeSkipped(clang::SourceRange sourceRange, clang::SourceLocation endifLoc); + void SourceRangeSkipped(clang::SourceRange sourceRange, clang::SourceLocation endifLoc) override; +#if (LUPDATE_CLANG_VERSION < LUPDATE_CLANG_VERSION_CHECK(14,0,0)) + void InclusionDirective(clang::SourceLocation /*hashLoc*/, const clang::Token &/*includeTok*/, + clang::StringRef /*fileName*/, bool /*isAngled*/, + clang::CharSourceRange /*filenameRange*/, +#if (LUPDATE_CLANG_VERSION >= LUPDATE_CLANG_VERSION_CHECK(16,0,0)) + const clang::OptionalFileEntryRef file, +#elif (LUPDATE_CLANG_VERSION >= LUPDATE_CLANG_VERSION_CHECK(15,0,0)) + const clang::Optional<clang::FileEntryRef> file, +#else + const clang::FileEntry *file, +#endif + clang::StringRef /*searchPath*/, clang::StringRef /*relativePath*/, + const clang::Module */*imported*/, + clang::SrcMgr::CharacteristicKind /*fileType*/) override; +#endif std::string m_inputFile; clang::Preprocessor &m_preprocessor; |