28 #ifndef ABSL_BASE_MACROS_H_ 29 #define ABSL_BASE_MACROS_H_ 42 #define ABSL_ARRAYSIZE(array) \ 43 (sizeof(::absl::macros_internal::ArraySizeHelper(array))) 46 namespace macros_internal {
49 template <
typename T,
size_t N>
75 namespace base_internal {
115 #ifdef ABSL_FALLTHROUGH_INTENDED 116 #error "ABSL_FALLTHROUGH_INTENDED should not be defined." 120 #if defined(__clang__) && defined(__has_warning) 121 #if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") 122 #define ABSL_FALLTHROUGH_INTENDED [[clang::fallthrough]] 124 #elif defined(__GNUC__) && __GNUC__ >= 7 125 #define ABSL_FALLTHROUGH_INTENDED [[gnu::fallthrough]] 128 #ifndef ABSL_FALLTHROUGH_INTENDED 129 #define ABSL_FALLTHROUGH_INTENDED \ 148 #if defined(__clang__) && __cplusplus >= 201103L 149 #define ABSL_DEPRECATED(message) __attribute__((deprecated(message))) 152 #ifndef ABSL_DEPRECATED 153 #define ABSL_DEPRECATED(message) 175 #if defined(__clang__) 176 # if __has_attribute(enable_if) 177 # define ABSL_BAD_CALL_IF(expr, msg) \ 178 __attribute__((enable_if(expr, "Bad call trap"), unavailable(msg))) 195 #define ABSL_ASSERT(expr) \ 196 (false ? static_cast<void>(expr) : static_cast<void>(0)) 198 #define ABSL_ASSERT(expr) \ 199 (ABSL_PREDICT_TRUE((expr)) ? static_cast<void>(0) \ 200 : [] { assert(false && #expr); }()) // NOLINT 203 #ifdef ABSL_HAVE_EXCEPTIONS 204 #define ABSL_INTERNAL_TRY try 205 #define ABSL_INTERNAL_CATCH_ANY catch (...) 206 #define ABSL_INTERNAL_RETHROW do { throw; } while (false) 207 #else // ABSL_HAVE_EXCEPTIONS 208 #define ABSL_INTERNAL_TRY if (true) 209 #define ABSL_INTERNAL_CATCH_ANY else if (false) 210 #define ABSL_INTERNAL_RETHROW do {} while (false) 211 #endif // ABSL_HAVE_EXCEPTIONS 213 #endif // ABSL_BASE_MACROS_H_
auto ArraySizeHelper(const T(&array)[N]) -> char(&)[N]