28 lines
615 B
C
28 lines
615 B
C
#define DIAG_STRINGIFY_(x) #x
|
|
#define DIAG_STRINGIFY(x) DIAG_STRINGIFY_(x)
|
|
|
|
#define DIAG_DO_PRAGMA(x) _Pragma(DIAG_STRINGIFY(x))
|
|
|
|
#if defined(__clang__)
|
|
|
|
#define DIAG_PUSH() DIAG_DO_PRAGMA(clang diagnostic push)
|
|
|
|
#define DIAG_POP() DIAG_DO_PRAGMA(clang diagnostic pop)
|
|
|
|
#define DIAG_IGNORE(w) DIAG_DO_PRAGMA(clang diagnostic ignored w)
|
|
|
|
#elif defined(__GNUC__)
|
|
|
|
#define DIAG_PUSH() DIAG_DO_PRAGMA(GCC diagnostic push)
|
|
|
|
#define DIAG_POP() DIAG_DO_PRAGMA(GCC diagnostic pop)
|
|
|
|
#define DIAG_IGNORE(w) DIAG_DO_PRAGMA(GCC diagnostic ignored w)
|
|
|
|
#else
|
|
|
|
#define DIAG_PUSH()
|
|
#define DIAG_POP()
|
|
#define DIAG_IGNORE(w)
|
|
|
|
#endif |