#include <mLib/bits.h>
#include <mLib/dstr.h>
+#include <mLib/macros.h>
#include <mLib/sym.h>
#ifndef CATACOMB_KEY_ERROR_H
unsigned m;
} key_filter;
-/* --- Matching aginst key selection --- *
- *
- * GCC will warn about constant addresses in this test, which is rather
- * unfortunate. Muffle the warning. This is rather hideous because of the
- * way GCC's parser handles pragmata.
- */
-
-#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
-# define KEY_MATCH_MUFFLE_WARNING(x) __extension__ ({ \
- _Pragma("GCC diagnostic push") \
- _Pragma("GCC diagnostic ignored \"-Waddress\"") \
- (x); \
- _Pragma("GCC diagnostic pop") \
- })
-#else
-# define KEY_MATCH_MUFFLE_WARNING(x) (x)
-#endif
+/* --- Matching aginst key selection --- */
#define KEY_MATCH(kd, kf) \
- (KEY_MATCH_MUFFLE_WARNING(!(kf)) || \
+ (MUFFLE_WARNINGS_EXPR(GCC_WARNING("-Waddress"), !(kf)) || \
((kd)->e & KF_ENCMASK) == KENC_STRUCT || \
((kd)->e & (kf)->m) == (kf)->f)