Go to the documentation of this file. 60 #ifndef ABSL_BASE_ATTRIBUTES_H_ 61 #define ABSL_BASE_ATTRIBUTES_H_ 73 #ifdef __has_attribute 74 #define ABSL_HAVE_ATTRIBUTE(x) __has_attribute(x) 76 #define ABSL_HAVE_ATTRIBUTE(x) 0 85 #if defined(__cplusplus) && defined(__has_cpp_attribute) 88 #define ABSL_HAVE_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) 90 #define ABSL_HAVE_CPP_ATTRIBUTE(x) 0 110 #if ABSL_HAVE_ATTRIBUTE(format) || (defined(__GNUC__) && !defined(__clang__)) 111 #define ABSL_PRINTF_ATTRIBUTE(string_index, first_to_check) \ 112 __attribute__((__format__(__printf__, string_index, first_to_check))) 113 #define ABSL_SCANF_ATTRIBUTE(string_index, first_to_check) \ 114 __attribute__((__format__(__scanf__, string_index, first_to_check))) 116 #define ABSL_PRINTF_ATTRIBUTE(string_index, first_to_check) 117 #define ABSL_SCANF_ATTRIBUTE(string_index, first_to_check) 124 #if ABSL_HAVE_ATTRIBUTE(always_inline) || \ 125 (defined(__GNUC__) && !defined(__clang__)) 126 #define ABSL_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) 127 #define ABSL_HAVE_ATTRIBUTE_ALWAYS_INLINE 1 129 #define ABSL_ATTRIBUTE_ALWAYS_INLINE 132 #if ABSL_HAVE_ATTRIBUTE(noinline) || (defined(__GNUC__) && !defined(__clang__)) 133 #define ABSL_ATTRIBUTE_NOINLINE __attribute__((noinline)) 134 #define ABSL_HAVE_ATTRIBUTE_NOINLINE 1 136 #define ABSL_ATTRIBUTE_NOINLINE 143 #if ABSL_HAVE_ATTRIBUTE(disable_tail_calls) 144 #define ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 1 145 #define ABSL_ATTRIBUTE_NO_TAIL_CALL __attribute__((disable_tail_calls)) 146 #elif defined(__GNUC__) && !defined(__clang__) 147 #define ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 1 148 #define ABSL_ATTRIBUTE_NO_TAIL_CALL \ 149 __attribute__((optimize("no-optimize-sibling-calls"))) 151 #define ABSL_ATTRIBUTE_NO_TAIL_CALL 152 #define ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 0 161 #if (ABSL_HAVE_ATTRIBUTE(weak) || \ 162 (defined(__GNUC__) && !defined(__clang__))) && \ 163 !(defined(__llvm__) && defined(_WIN32)) 164 #undef ABSL_ATTRIBUTE_WEAK 165 #define ABSL_ATTRIBUTE_WEAK __attribute__((weak)) 166 #define ABSL_HAVE_ATTRIBUTE_WEAK 1 168 #define ABSL_ATTRIBUTE_WEAK 169 #define ABSL_HAVE_ATTRIBUTE_WEAK 0 210 #if ABSL_HAVE_ATTRIBUTE(nonnull) || (defined(__GNUC__) && !defined(__clang__)) 211 #define ABSL_ATTRIBUTE_NONNULL(arg_index) __attribute__((nonnull(arg_index))) 213 #define ABSL_ATTRIBUTE_NONNULL(...) 219 #if ABSL_HAVE_ATTRIBUTE(noreturn) || (defined(__GNUC__) && !defined(__clang__)) 220 #define ABSL_ATTRIBUTE_NORETURN __attribute__((noreturn)) 221 #elif defined(_MSC_VER) 222 #define ABSL_ATTRIBUTE_NORETURN __declspec(noreturn) 224 #define ABSL_ATTRIBUTE_NORETURN 235 #if defined(__GNUC__) && defined(ADDRESS_SANITIZER) 236 #define ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) 238 #define ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS 249 #if defined(__GNUC__) && defined(MEMORY_SANITIZER) 250 #define ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory)) 252 #define ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY 260 #if defined(__GNUC__) && defined(THREAD_SANITIZER) 261 #define ABSL_ATTRIBUTE_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread)) 263 #define ABSL_ATTRIBUTE_NO_SANITIZE_THREAD 272 #if defined(__GNUC__) && \ 273 (defined(UNDEFINED_BEHAVIOR_SANITIZER) || defined(ADDRESS_SANITIZER)) 274 #define ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED \ 275 __attribute__((no_sanitize("undefined"))) 277 #define ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED 284 #if defined(__GNUC__) && defined(CONTROL_FLOW_INTEGRITY) 285 #define ABSL_ATTRIBUTE_NO_SANITIZE_CFI __attribute__((no_sanitize("cfi"))) 287 #define ABSL_ATTRIBUTE_NO_SANITIZE_CFI 294 #if defined(__GNUC__) && defined(SAFESTACK_SANITIZER) 295 #define ABSL_ATTRIBUTE_NO_SANITIZE_SAFESTACK \ 296 __attribute__((no_sanitize("safe-stack"))) 298 #define ABSL_ATTRIBUTE_NO_SANITIZE_SAFESTACK 304 #if ABSL_HAVE_ATTRIBUTE(returns_nonnull) || \ 305 (defined(__GNUC__) && \ 306 (__GNUC__ > 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) && \ 308 #define ABSL_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull)) 310 #define ABSL_ATTRIBUTE_RETURNS_NONNULL 317 #ifdef ABSL_HAVE_ATTRIBUTE_SECTION 318 #error ABSL_HAVE_ATTRIBUTE_SECTION cannot be directly set 319 #elif (ABSL_HAVE_ATTRIBUTE(section) || \ 320 (defined(__GNUC__) && !defined(__clang__))) && \ 321 !defined(__APPLE__) && ABSL_HAVE_ATTRIBUTE_WEAK 322 #define ABSL_HAVE_ATTRIBUTE_SECTION 1 332 #ifndef ABSL_ATTRIBUTE_SECTION 333 #define ABSL_ATTRIBUTE_SECTION(name) \ 334 __attribute__((section(#name))) __attribute__((noinline)) 343 #ifndef ABSL_ATTRIBUTE_SECTION_VARIABLE 344 #define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) __attribute__((section(#name))) 355 #ifndef ABSL_DECLARE_ATTRIBUTE_SECTION_VARS 356 #define ABSL_DECLARE_ATTRIBUTE_SECTION_VARS(name) \ 357 extern char __start_##name[] ABSL_ATTRIBUTE_WEAK; \ 358 extern char __stop_##name[] ABSL_ATTRIBUTE_WEAK 360 #ifndef ABSL_DEFINE_ATTRIBUTE_SECTION_VARS 361 #define ABSL_INIT_ATTRIBUTE_SECTION_VARS(name) 362 #define ABSL_DEFINE_ATTRIBUTE_SECTION_VARS(name) 373 #define ABSL_ATTRIBUTE_SECTION_START(name) \ 374 (reinterpret_cast<void *>(__start_##name)) 375 #define ABSL_ATTRIBUTE_SECTION_STOP(name) \ 376 (reinterpret_cast<void *>(__stop_##name)) 378 #else // !ABSL_HAVE_ATTRIBUTE_SECTION 380 #define ABSL_HAVE_ATTRIBUTE_SECTION 0 383 #define ABSL_ATTRIBUTE_SECTION(name) 384 #define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) 385 #define ABSL_INIT_ATTRIBUTE_SECTION_VARS(name) 386 #define ABSL_DEFINE_ATTRIBUTE_SECTION_VARS(name) 387 #define ABSL_DECLARE_ATTRIBUTE_SECTION_VARS(name) 388 #define ABSL_ATTRIBUTE_SECTION_START(name) (reinterpret_cast<void *>(0)) 389 #define ABSL_ATTRIBUTE_SECTION_STOP(name) (reinterpret_cast<void *>(0)) 391 #endif // ABSL_ATTRIBUTE_SECTION 396 #if ABSL_HAVE_ATTRIBUTE(force_align_arg_pointer) || \ 397 (defined(__GNUC__) && !defined(__clang__)) 398 #if defined(__i386__) 399 #define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC \ 400 __attribute__((force_align_arg_pointer)) 401 #define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) 402 #elif defined(__x86_64__) 403 #define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (1) 404 #define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC 405 #else // !__i386__ && !__x86_64 406 #define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) 407 #define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC 410 #define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC 411 #define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) 444 #if ABSL_HAVE_ATTRIBUTE(nodiscard) 445 #define ABSL_MUST_USE_RESULT [[nodiscard]] 446 #elif defined(__clang__) && ABSL_HAVE_ATTRIBUTE(warn_unused_result) 447 #define ABSL_MUST_USE_RESULT __attribute__((warn_unused_result)) 449 #define ABSL_MUST_USE_RESULT 462 #if ABSL_HAVE_ATTRIBUTE(hot) || (defined(__GNUC__) && !defined(__clang__)) 463 #define ABSL_ATTRIBUTE_HOT __attribute__((hot)) 465 #define ABSL_ATTRIBUTE_HOT 468 #if ABSL_HAVE_ATTRIBUTE(cold) || (defined(__GNUC__) && !defined(__clang__)) 469 #define ABSL_ATTRIBUTE_COLD __attribute__((cold)) 471 #define ABSL_ATTRIBUTE_COLD 508 #if ABSL_HAVE_CPP_ATTRIBUTE(clang::xray_always_instrument) && \ 509 !defined(ABSL_NO_XRAY_ATTRIBUTES) 510 #define ABSL_XRAY_ALWAYS_INSTRUMENT [[clang::xray_always_instrument]] 511 #define ABSL_XRAY_NEVER_INSTRUMENT [[clang::xray_never_instrument]] 512 #if ABSL_HAVE_CPP_ATTRIBUTE(clang::xray_log_args) 513 #define ABSL_XRAY_LOG_ARGS(N) \ 514 [[clang::xray_always_instrument, clang::xray_log_args(N)]] 516 #define ABSL_XRAY_LOG_ARGS(N) [[clang::xray_always_instrument]] 519 #define ABSL_XRAY_ALWAYS_INSTRUMENT 520 #define ABSL_XRAY_NEVER_INSTRUMENT 521 #define ABSL_XRAY_LOG_ARGS(N) 532 #if ABSL_HAVE_CPP_ATTRIBUTE(clang::reinitializes) 533 #define ABSL_ATTRIBUTE_REINITIALIZES [[clang::reinitializes]] 535 #define ABSL_ATTRIBUTE_REINITIALIZES 545 #if ABSL_HAVE_ATTRIBUTE(unused) || (defined(__GNUC__) && !defined(__clang__)) 546 #undef ABSL_ATTRIBUTE_UNUSED 547 #define ABSL_ATTRIBUTE_UNUSED __attribute__((__unused__)) 549 #define ABSL_ATTRIBUTE_UNUSED 556 #if ABSL_HAVE_ATTRIBUTE(tls_model) || (defined(__GNUC__) && !defined(__clang__)) 557 #define ABSL_ATTRIBUTE_INITIAL_EXEC __attribute__((tls_model("initial-exec"))) 559 #define ABSL_ATTRIBUTE_INITIAL_EXEC 565 #if ABSL_HAVE_ATTRIBUTE(packed) || (defined(__GNUC__) && !defined(__clang__)) 566 #define ABSL_ATTRIBUTE_PACKED __attribute__((__packed__)) 568 #define ABSL_ATTRIBUTE_PACKED 575 #if ABSL_HAVE_ATTRIBUTE(aligned) || (defined(__GNUC__) && !defined(__clang__)) 576 #define ABSL_ATTRIBUTE_FUNC_ALIGN(bytes) __attribute__((aligned(bytes))) 578 #define ABSL_ATTRIBUTE_FUNC_ALIGN(bytes) 601 #if ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) 603 #define ABSL_CONST_INIT [[clang::require_constant_initialization]] 605 #define ABSL_CONST_INIT 606 #endif // ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) 608 #endif // ABSL_BASE_ATTRIBUTES_H_
abseil_cpp
Author(s):
autogenerated on Wed Jun 19 2019 19:19:56