diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-07-01 13:42:52 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-07-01 16:15:49 +0200 |
commit | cbd88ff4328ee43f1123c38c174f238609565513 (patch) | |
tree | c13105027941a6ca99d7a33214ba576c845fcf10 /src/linguist/lupdate | |
parent | a2a191873c79f2447c83b051dbc22c51acff149e (diff) | |
download | qttools-cbd88ff4328ee43f1123c38c174f238609565513.tar.gz |
linguist: port from \#pragma to QT_WARNING macros
We need to add some warning suppressions for GCC, too. Using the
macros makes things easier.
Task-number: QTBUG-104713
Pick-to: 6.4 6.3 6.2
Change-Id: Ia4782ee283a03f60d7cc6c86b72e3d872030ad79
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/linguist/lupdate')
-rw-r--r-- | src/linguist/lupdate/clangtoolastreader.h | 17 | ||||
-rw-r--r-- | src/linguist/lupdate/cpp_clang.h | 16 | ||||
-rw-r--r-- | src/linguist/lupdate/lupdatepreprocessoraction.h | 16 |
3 files changed, 19 insertions, 30 deletions
diff --git a/src/linguist/lupdate/clangtoolastreader.h b/src/linguist/lupdate/clangtoolastreader.h index b4d9bbd47..bb8255537 100644 --- a/src/linguist/lupdate/clangtoolastreader.h +++ b/src/linguist/lupdate/clangtoolastreader.h @@ -5,22 +5,19 @@ #define CLANG_TOOL_AST_READER_H #include "cpp_clang.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) #include <clang/AST/RecursiveASTVisitor.h> #include <clang/Frontend/CompilerInstance.h> #include <clang/Frontend/FrontendActions.h> #include <clang/Tooling/Tooling.h> -#if defined(Q_CC_MSVC) -# pragma warning(pop) -#endif +QT_WARNING_POP #include <iostream> #include <memory> diff --git a/src/linguist/lupdate/cpp_clang.h b/src/linguist/lupdate/cpp_clang.h index e646faf8b..e16bf5d53 100644 --- a/src/linguist/lupdate/cpp_clang.h +++ b/src/linguist/lupdate/cpp_clang.h @@ -11,22 +11,18 @@ #include <QtCore/qregularexpression.h> #include <QtCore/qstring.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) #include <llvm/ADT/StringRef.h> #include <clang/Basic/SourceLocation.h> #include <clang/Basic/SourceManager.h> #include <clang/Basic/FileManager.h> -#if defined(Q_CC_MSVC) -# pragma warning(pop) -#endif +QT_WARNING_POP #include <vector> #include <iostream> diff --git a/src/linguist/lupdate/lupdatepreprocessoraction.h b/src/linguist/lupdate/lupdatepreprocessoraction.h index 8e120c9eb..e97963e62 100644 --- a/src/linguist/lupdate/lupdatepreprocessoraction.h +++ b/src/linguist/lupdate/lupdatepreprocessoraction.h @@ -7,13 +7,11 @@ #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) #include <clang/Frontend/CompilerInstance.h> #include <clang/Frontend/FrontendActions.h> @@ -21,9 +19,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> |