pdiagnostic_push.h (1179B)
1 /* 2 * See also comment in "pdiagnostic.h" 3 * 4 * e.g. 5 * #define PDIAGNOSTIC_IGNORE_USED_FUNCTION 6 * #define PDIAGNOSTIC_IGNORE_USED_VARIABLE 7 * #include "pdiagnostic_push" 8 * ... 9 * #include "pdiagnostic_pop.h" 10 * <eof> 11 * 12 * or if push pop isn't desired: 13 * #define PDIAGNOSTIC_IGNORE_USED_FUNCTION 14 * #define PDIAGNOSTIC_IGNORE_USED_VARIABLE 15 * #include "pdiagnostic.h" 16 * ... 17 * <eof> 18 * 19 * 20 * Some if these warnings cannot be ignored 21 * at the #pragma level, but might in the future. 22 * Use compiler switches like -Wno-unused-function 23 * to work around this. 24 */ 25 26 #if defined(_MSC_VER) 27 #pragma warning( push ) 28 #define PDIAGNOSTIC_PUSHED_MSVC 1 29 #else 30 #define PDIAGNOSTIC_PUSHED_MSVC 0 31 #endif 32 33 #if defined(__clang__) 34 #pragma clang diagnostic push 35 #define PDIAGNOSTIC_PUSHED_CLANG 1 36 #else 37 #define PDIAGNOSTIC_PUSHED_CLANG 0 38 #endif 39 40 #if defined(__GNUC__) && !defined(__clang__) 41 #if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) 42 #pragma GCC diagnostic push 43 #define PDIAGNOSTIC_PUSHED_GCC 1 44 #else 45 #define PDIAGNOSTIC_PUSHED_GCC 0 46 #endif // GNUC >= 4.6 47 #else 48 #define PDIAGNOSTIC_PUSHED_GCC 0 49 #endif // defined(__GNUC__) && !defined(__clang__) 50 51 #include "pdiagnostic.h"