]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Backport 'DIAG_UNKNOWN_PRAGMAS' macro from v4
authorJorge Pereira <jpereiran@gmail.com>
Thu, 16 Mar 2023 21:56:34 +0000 (18:56 -0300)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 17 Mar 2023 13:16:46 +0000 (09:16 -0400)
src/include/build.h

index e1c2a1c79bfc6e552814e8088b1cfa726c5b48fc..069216eb02cdbcc73f4e0e785151f980404beabb 100644 (file)
@@ -82,6 +82,7 @@ extern "C" {
  *     Macros for controlling warnings in GCC >= 4.2 and clang >= 2.8
  */
 #if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402
+#  define DIAG_UNKNOWN_PRAGMAS pragmas
 #  define DIAG_PRAGMA(_x) PRAGMA(GCC diagnostic _x)
 #  if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
 #    define DIAG_OFF(_x) DIAG_PRAGMA(push) DIAG_PRAGMA(ignored JOINSTR(-W,_x))
@@ -91,10 +92,12 @@ extern "C" {
 #    define DIAG_ON(_x)  DIAG_PRAGMA(warning JOINSTR(-W,_x))
 #  endif
 #elif defined(__clang__) && ((__clang_major__ * 100) + __clang_minor__ >= 208)
+#  define DIAG_UNKNOWN_PRAGMAS unknown-pragmas
 #  define DIAG_PRAGMA(_x) PRAGMA(clang diagnostic _x)
 #  define DIAG_OFF(_x) DIAG_PRAGMA(push) DIAG_PRAGMA(ignored JOINSTR(-W,_x))
 #  define DIAG_ON(_x) DIAG_PRAGMA(pop)
 #else
+#  define DIAG_UNKNOWN_PRAGMAS
 #  define DIAG_OFF(_x)
 #  define DIAG_ON(_x)
 #endif