Go to the documentation of this file. 1 #ifndef cetlib_compiler_macros_h 2 #define cetlib_compiler_macros_h 9 #if defined __GNUC_PATCHLEVEL__ 11 (100000 * __GNUC__ + 1000 * __GNUC_MINOR__ + __GNUC_PATCHLEVEL__) 12 #elif defined __GNUC_MINOR__ 13 #define GCC_VERSION (10000 * __GNUC__ + 1000 * __GNUC_MINOR__) 14 #elif defined __GNUC__ 15 #define GCC_VERSION (10000 * __GNUC__) 22 #if defined __clang_patchlevel__ 23 #define CLANG_VERSION \ 24 (100000 * __clang_major__ + 1000 * __clang_minor__ + __clang_patchlevel__) 25 #elif defined __clang_minor__ 26 #define CLANG_VERSION (10000 * __clang_major__ + 1000 * __clang_minor__) 27 #elif defined __clang_major__ 28 #define CLANG_VERSION (10000 * __clang_major__) 30 #define CLANG_VERSION 0 34 #ifndef GCC_IS_AT_LEAST 36 #define GCC_IS_AT_LEAST(major, minor, patch) \ 37 GCC_VERSION >= ((100000 * (major)) + (1000 * (minor)) + (patch)) 39 #define GCC_IS_AT_LEAST(major, minor, patch) 0 43 #ifdef __apple_build_version__ 44 #ifndef APPLE_CLANG_IS_AT_LEAST 45 #define APPLE_CLANG_IS_AT_LEAST(major, minor, patch) \ 46 CLANG_VERSION >= ((100000 * (major)) + (1000 * (minor)) + (patch)) 48 #ifndef CLANG_IS_AT_LEAST 49 #define CLANG_IS_AT_LEAST(major, minor, patch) 0 52 #ifndef CLANG_IS_AT_LEAST 53 #define CLANG_IS_AT_LEAST(major, minor, patch) \ 54 CLANG_VERSION >= ((100000 * (major)) + (1000 * (minor)) + (patch)) 56 #ifndef APPLE_CLANG_IS_AT_LEAST 57 #define APPLE_CLANG_IS_AT_LEAST(major, minor, patch) 0 67 #ifndef EXTERN_C_FUNC_DECLARE_START_DETAIL 68 #define EXTERN_C_FUNC_DECLARE_START_DETAIL extern "C" { 71 #define EXTERN_C_FUNC_DECLARE_START \ 72 _Pragma("clang diagnostic push") \ 73 _Pragma("clang diagnostic ignored \"-Wreturn-type-c-linkage\"") \ 74 EXTERN_C_FUNC_DECLARE_START_DETAIL 75 #define EXTERN_C_FUNC_DECLARE_END \ 77 _Pragma("clang diagnostic pop") 79 #define EXTERN_C_FUNC_DECLARE_START EXTERN_C_FUNC_DECLARE_START_DETAIL 80 #define EXTERN_C_FUNC_DECLARE_END } 89 #if __cplusplus >= 201703L 90 #if __has_cpp_attribute(fallthrough) 91 #define FALLTHROUGH [[fallthrough]] 93 #define FALLTHROUGH [[gnu::fallthrough]] 96 #define FALLTHROUGH while (0) 105 #ifndef IGNORE_FALLTHROUGH_START 106 #if defined(__clang__) || GCC_IS_AT_LEAST(7, 1, 0) 107 #define IGNORE_FALLTHROUGH_START \ 108 _Pragma("GCC diagnostic push") \ 109 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") 110 #define IGNORE_FALLTHROUGH_END _Pragma("GCC diagnostic pop") 112 #define IGNORE_FALLTHROUGH_START 113 #define IGNORE_FALLTHROUGH_END 122 #ifndef UNUSED_PRIVATE_FIELD 124 #if __has_cpp_attribute(maybe_unused) 125 #define UNUSED_PRIVATE_FIELD [[maybe_unused]] 127 #define UNUSED_PRIVATE_FIELD [[gnu::unused]] 130 #define UNUSED_PRIVATE_FIELD