]> git.lyx.org Git - lyx.git/commitdiff
Move LYX_(BEGIN|END)_MUTE_GCC_WARNING macros to their own header.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 10 Nov 2023 12:14:34 +0000 (13:14 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 10 Nov 2023 12:14:34 +0000 (13:14 +0100)
It was not nice to other build systems to define that in configure.ac.

configure.ac
src/Mover.h
src/WordList.h
src/frontends/FontMetrics.h
src/frontends/qt/GuiApplication.cpp
src/support/Makefile.am

index 6688cbfb9485196e1f5468082a034fc669b1303f..d93bf4eb36a43632c795b7cc65fff9dd6c6fa3e8 100644 (file)
@@ -313,32 +313,6 @@ char * strerror(int n);
 #  define USE_WCHAR_T
 #endif
 
-#if defined(__GNUC__) && !defined(__clang__)
-/* This macro can be used to stipulate that a given GCC warning is not
- * relevant in a given block.
- *
- * The -Wpragmas bit takes care of the case where -W<warn> is not implemented
- *
- * The idea for PRAGMA_IGNORE has been stolen from
- * https://stackoverflow.com/questions/45762357/how-to-concatenate-strings-in-the-arguments-of-pragma#comment124444258_45783809
- * The difficulty is to put the <warn> value inside nested quotes; it is done
- * using nested macros.
- */
-#  define PRAGMA_IGNORE(x) PRAGMA_IGNORE_1(-W##x)
-#  define PRAGMA_IGNORE_1(x) PRAGMA_IGNORE_2(#x)
-#  define PRAGMA_IGNORE_2(x) PRAGMA_IGNORE_3(GCC diagnostic ignored x)
-#  define PRAGMA_IGNORE_3(x) _Pragma(#x)
-#  define LYX_BEGIN_MUTE_GCC_WARNING(warn)             \
-  _Pragma("GCC diagnostic push") \
-  _Pragma("GCC diagnostic ignored \"-Wpragmas\"") \
-  PRAGMA_IGNORE(warn)
-#  define LYX_END_MUTE_GCC_WARNING \
-  _Pragma("GCC diagnostic pop")
-#else
-#  define LYX_BEGIN_MUTE_GCC_WARNING(warn)
-#  define LYX_END_MUTE_GCC_WARNING
-#endif
-
 
 #endif
 ])
index 1cd3698e726486401794f6a0362ed0af1607ee1d..bfddd95a30062440ef1aee6c58f73c4827aff1c4 100644 (file)
@@ -15,6 +15,7 @@
 #include <map>
 #include <string>
 
+#include "support/mute_warning.h"
 
 namespace lyx {
 
index 9819a31bbe0fffb7396e578071dd399346c094b7..9c2eaf1b8e7539ef250b20c887b9e2370ed54a89 100644 (file)
@@ -13,6 +13,7 @@
 #define WORDLIST_H
 
 #include "support/docstring.h"
+#include "support/mute_warning.h"
 
 #include <memory>
 
index c1b7e028ebc51976bc586bdf9a0182d9608be141..c9a1d86cda4112a58a52a27e1ef24b504884f2b5 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef FONT_METRICS_H
 #define FONT_METRICS_H
 
+
+#include "support/mute_warning.h"
 #include "support/strfwd.h"
 
 #include <vector>
index 44b4278be6137f7e8102dcfe25cb764847193153..26288a5f55dd1cf148b1153fa56493f947480c7f 100644 (file)
@@ -71,6 +71,7 @@
 #include "support/lassert.h"
 #include "support/lstrings.h"
 #include "support/lyxalgo.h" // sorted
+#include "support/mute_warning.h"
 #include "support/textutils.h"
 #include "support/Messages.h"
 #include "support/os.h"
index 925cb62d04fee19b88766952432adbdfd52bbfd3..2c2fce5f46a8d072d1c93a408bd72cbac87ff25f 100644 (file)
@@ -85,6 +85,7 @@ liblyxsupport_a_SOURCES = \
        lyxmagic.h \
        lyxtime.cpp \
        lyxtime.h \
+       mute_warning.h \
        mutex.h \
        mutex.cpp \
        Messages.cpp \