diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-04 14:03:06 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-03-04 14:03:06 +0300 |
commit | b61be8e632d1cafa8afb229ea0a5b6117ca7125b (patch) | |
tree | 96a36f21d4064f32d1912cbc85e4135788ff70b3 /contrib/restricted/abseil-cpp-tstring/y_absl/base | |
parent | 7ce58bf82abf75fdc15c2e6fa3aceadcfecfdca1 (diff) | |
download | ydb-b61be8e632d1cafa8afb229ea0a5b6117ca7125b.tar.gz |
intermediate changes
ref:c67faec740b4d59ed47c6dfdc7076c904650af60
Diffstat (limited to 'contrib/restricted/abseil-cpp-tstring/y_absl/base')
61 files changed, 1582 insertions, 1582 deletions
diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/attributes.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/attributes.h index 8321acda51..66751eaddf 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/attributes.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/attributes.h @@ -31,12 +31,12 @@ // `__has_attribute()` first. If the check fails, we check if we are on GCC and // assume the attribute exists on GCC (which is verified on GCC 4.7). -#ifndef ABSL_BASE_ATTRIBUTES_H_ -#define ABSL_BASE_ATTRIBUTES_H_ +#ifndef Y_ABSL_BASE_ATTRIBUTES_H_ +#define Y_ABSL_BASE_ATTRIBUTES_H_ #include "y_absl/base/config.h" -// ABSL_HAVE_ATTRIBUTE +// Y_ABSL_HAVE_ATTRIBUTE // // A function-like feature checking macro that is a wrapper around // `__has_attribute`, which is defined by GCC 5+ and Clang and evaluates to a @@ -47,12 +47,12 @@ // GCC: https://gcc.gnu.org/gcc-5/changes.html // Clang: https://clang.llvm.org/docs/LanguageExtensions.html #ifdef __has_attribute -#define ABSL_HAVE_ATTRIBUTE(x) __has_attribute(x) +#define Y_ABSL_HAVE_ATTRIBUTE(x) __has_attribute(x) #else -#define ABSL_HAVE_ATTRIBUTE(x) 0 +#define Y_ABSL_HAVE_ATTRIBUTE(x) 0 #endif -// ABSL_HAVE_CPP_ATTRIBUTE +// Y_ABSL_HAVE_CPP_ATTRIBUTE // // A function-like feature checking macro that accepts C++11 style attributes. // It's a wrapper around `__has_cpp_attribute`, defined by ISO C++ SD-6 @@ -61,9 +61,9 @@ #if defined(__cplusplus) && defined(__has_cpp_attribute) // NOTE: requiring __cplusplus above should not be necessary, but // works around https://bugs.llvm.org/show_bug.cgi?id=23435. -#define ABSL_HAVE_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) +#define Y_ABSL_HAVE_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) #else -#define ABSL_HAVE_CPP_ATTRIBUTE(x) 0 +#define Y_ABSL_HAVE_CPP_ATTRIBUTE(x) 0 #endif // ----------------------------------------------------------------------------- @@ -73,8 +73,8 @@ // GCC: https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html // Clang: https://clang.llvm.org/docs/AttributeReference.html -// ABSL_PRINTF_ATTRIBUTE -// ABSL_SCANF_ATTRIBUTE +// Y_ABSL_PRINTF_ATTRIBUTE +// Y_ABSL_SCANF_ATTRIBUTE // // Tells the compiler to perform `printf` format string checking if the // compiler supports it; see the 'format' attribute in @@ -83,52 +83,52 @@ // Note: As the GCC manual states, "[s]ince non-static C++ methods // have an implicit 'this' argument, the arguments of such methods // should be counted from two, not one." -#if ABSL_HAVE_ATTRIBUTE(format) || (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_PRINTF_ATTRIBUTE(string_index, first_to_check) \ +#if Y_ABSL_HAVE_ATTRIBUTE(format) || (defined(__GNUC__) && !defined(__clang__)) +#define Y_ABSL_PRINTF_ATTRIBUTE(string_index, first_to_check) \ __attribute__((__format__(__printf__, string_index, first_to_check))) -#define ABSL_SCANF_ATTRIBUTE(string_index, first_to_check) \ +#define Y_ABSL_SCANF_ATTRIBUTE(string_index, first_to_check) \ __attribute__((__format__(__scanf__, string_index, first_to_check))) #else -#define ABSL_PRINTF_ATTRIBUTE(string_index, first_to_check) -#define ABSL_SCANF_ATTRIBUTE(string_index, first_to_check) +#define Y_ABSL_PRINTF_ATTRIBUTE(string_index, first_to_check) +#define Y_ABSL_SCANF_ATTRIBUTE(string_index, first_to_check) #endif -// ABSL_ATTRIBUTE_ALWAYS_INLINE -// ABSL_ATTRIBUTE_NOINLINE +// Y_ABSL_ATTRIBUTE_ALWAYS_INLINE +// Y_ABSL_ATTRIBUTE_NOINLINE // // Forces functions to either inline or not inline. Introduced in gcc 3.1. -#if ABSL_HAVE_ATTRIBUTE(always_inline) || \ +#if Y_ABSL_HAVE_ATTRIBUTE(always_inline) || \ (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) -#define ABSL_HAVE_ATTRIBUTE_ALWAYS_INLINE 1 +#define Y_ABSL_ATTRIBUTE_ALWAYS_INLINE __attribute__((always_inline)) +#define Y_ABSL_HAVE_ATTRIBUTE_ALWAYS_INLINE 1 #else -#define ABSL_ATTRIBUTE_ALWAYS_INLINE +#define Y_ABSL_ATTRIBUTE_ALWAYS_INLINE #endif -#if ABSL_HAVE_ATTRIBUTE(noinline) || (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_ATTRIBUTE_NOINLINE __attribute__((noinline)) -#define ABSL_HAVE_ATTRIBUTE_NOINLINE 1 +#if Y_ABSL_HAVE_ATTRIBUTE(noinline) || (defined(__GNUC__) && !defined(__clang__)) +#define Y_ABSL_ATTRIBUTE_NOINLINE __attribute__((noinline)) +#define Y_ABSL_HAVE_ATTRIBUTE_NOINLINE 1 #else -#define ABSL_ATTRIBUTE_NOINLINE +#define Y_ABSL_ATTRIBUTE_NOINLINE #endif -// ABSL_ATTRIBUTE_NO_TAIL_CALL +// Y_ABSL_ATTRIBUTE_NO_TAIL_CALL // // Prevents the compiler from optimizing away stack frames for functions which // end in a call to another function. -#if ABSL_HAVE_ATTRIBUTE(disable_tail_calls) -#define ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 1 -#define ABSL_ATTRIBUTE_NO_TAIL_CALL __attribute__((disable_tail_calls)) +#if Y_ABSL_HAVE_ATTRIBUTE(disable_tail_calls) +#define Y_ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 1 +#define Y_ABSL_ATTRIBUTE_NO_TAIL_CALL __attribute__((disable_tail_calls)) #elif defined(__GNUC__) && !defined(__clang__) && !defined(__e2k__) -#define ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 1 -#define ABSL_ATTRIBUTE_NO_TAIL_CALL \ +#define Y_ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 1 +#define Y_ABSL_ATTRIBUTE_NO_TAIL_CALL \ __attribute__((optimize("no-optimize-sibling-calls"))) #else -#define ABSL_ATTRIBUTE_NO_TAIL_CALL -#define ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 0 +#define Y_ABSL_ATTRIBUTE_NO_TAIL_CALL +#define Y_ABSL_HAVE_ATTRIBUTE_NO_TAIL_CALL 0 #endif -// ABSL_ATTRIBUTE_WEAK +// Y_ABSL_ATTRIBUTE_WEAK // // Tags a function as weak for the purposes of compilation and linking. // Weak attributes did not work properly in LLVM's Windows backend before @@ -136,18 +136,18 @@ // for further information. // The MinGW compiler doesn't complain about the weak attribute until the link // step, presumably because Windows doesn't use ELF binaries. -#if (ABSL_HAVE_ATTRIBUTE(weak) || \ +#if (Y_ABSL_HAVE_ATTRIBUTE(weak) || \ (defined(__GNUC__) && !defined(__clang__))) && \ (!defined(_WIN32) || __clang_major__ < 9) && !defined(__MINGW32__) -#undef ABSL_ATTRIBUTE_WEAK -#define ABSL_ATTRIBUTE_WEAK __attribute__((weak)) -#define ABSL_HAVE_ATTRIBUTE_WEAK 1 +#undef Y_ABSL_ATTRIBUTE_WEAK +#define Y_ABSL_ATTRIBUTE_WEAK __attribute__((weak)) +#define Y_ABSL_HAVE_ATTRIBUTE_WEAK 1 #else -#define ABSL_ATTRIBUTE_WEAK -#define ABSL_HAVE_ATTRIBUTE_WEAK 0 +#define Y_ABSL_ATTRIBUTE_WEAK +#define Y_ABSL_HAVE_ATTRIBUTE_WEAK 0 #endif -// ABSL_ATTRIBUTE_NONNULL +// Y_ABSL_ATTRIBUTE_NONNULL // // Tells the compiler either (a) that a particular function parameter // should be a non-null pointer, or (b) that all pointer arguments should @@ -167,42 +167,42 @@ // Example: // // /* arg_a cannot be null, but arg_b can */ -// void Function(void* arg_a, void* arg_b) ABSL_ATTRIBUTE_NONNULL(1); +// void Function(void* arg_a, void* arg_b) Y_ABSL_ATTRIBUTE_NONNULL(1); // // class C { // /* arg_a cannot be null, but arg_b can */ -// void Method(void* arg_a, void* arg_b) ABSL_ATTRIBUTE_NONNULL(2); +// void Method(void* arg_a, void* arg_b) Y_ABSL_ATTRIBUTE_NONNULL(2); // // /* arg_a cannot be null, but arg_b can */ // static void StaticMethod(void* arg_a, void* arg_b) -// ABSL_ATTRIBUTE_NONNULL(1); +// Y_ABSL_ATTRIBUTE_NONNULL(1); // }; // // If no arguments are provided, then all pointer arguments should be non-null. // // /* No pointer arguments may be null. */ -// void Function(void* arg_a, void* arg_b, int arg_c) ABSL_ATTRIBUTE_NONNULL(); +// void Function(void* arg_a, void* arg_b, int arg_c) Y_ABSL_ATTRIBUTE_NONNULL(); // // NOTE: The GCC nonnull attribute actually accepts a list of arguments, but -// ABSL_ATTRIBUTE_NONNULL does not. -#if ABSL_HAVE_ATTRIBUTE(nonnull) || (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_ATTRIBUTE_NONNULL(arg_index) __attribute__((nonnull(arg_index))) +// Y_ABSL_ATTRIBUTE_NONNULL does not. +#if Y_ABSL_HAVE_ATTRIBUTE(nonnull) || (defined(__GNUC__) && !defined(__clang__)) +#define Y_ABSL_ATTRIBUTE_NONNULL(arg_index) __attribute__((nonnull(arg_index))) #else -#define ABSL_ATTRIBUTE_NONNULL(...) +#define Y_ABSL_ATTRIBUTE_NONNULL(...) #endif -// ABSL_ATTRIBUTE_NORETURN +// Y_ABSL_ATTRIBUTE_NORETURN // // Tells the compiler that a given function never returns. -#if ABSL_HAVE_ATTRIBUTE(noreturn) || (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_ATTRIBUTE_NORETURN __attribute__((noreturn)) +#if Y_ABSL_HAVE_ATTRIBUTE(noreturn) || (defined(__GNUC__) && !defined(__clang__)) +#define Y_ABSL_ATTRIBUTE_NORETURN __attribute__((noreturn)) #elif defined(_MSC_VER) -#define ABSL_ATTRIBUTE_NORETURN __declspec(noreturn) +#define Y_ABSL_ATTRIBUTE_NORETURN __declspec(noreturn) #else -#define ABSL_ATTRIBUTE_NORETURN +#define Y_ABSL_ATTRIBUTE_NORETURN #endif -// ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS +// Y_ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS // // Tells the AddressSanitizer (or other memory testing tools) to ignore a given // function. Useful for cases when a function reads random locations on stack, @@ -210,193 +210,193 @@ // out of bounds or does other scary things with memory. // NOTE: GCC supports AddressSanitizer(asan) since 4.8. // https://gcc.gnu.org/gcc-4.8/changes.html -#if ABSL_HAVE_ATTRIBUTE(no_sanitize_address) -#define ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) +#if Y_ABSL_HAVE_ATTRIBUTE(no_sanitize_address) +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) #else -#define ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS #endif -// ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY +// Y_ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY // // Tells the MemorySanitizer to relax the handling of a given function. All "Use // of uninitialized value" warnings from such functions will be suppressed, and // all values loaded from memory will be considered fully initialized. This -// attribute is similar to the ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS attribute +// attribute is similar to the Y_ABSL_ATTRIBUTE_NO_SANITIZE_ADDRESS attribute // above, but deals with initialized-ness rather than addressability issues. // NOTE: MemorySanitizer(msan) is supported by Clang but not GCC. -#if ABSL_HAVE_ATTRIBUTE(no_sanitize_memory) -#define ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory)) +#if Y_ABSL_HAVE_ATTRIBUTE(no_sanitize_memory) +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY __attribute__((no_sanitize_memory)) #else -#define ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_MEMORY #endif -// ABSL_ATTRIBUTE_NO_SANITIZE_THREAD +// Y_ABSL_ATTRIBUTE_NO_SANITIZE_THREAD // // Tells the ThreadSanitizer to not instrument a given function. // NOTE: GCC supports ThreadSanitizer(tsan) since 4.8. // https://gcc.gnu.org/gcc-4.8/changes.html -#if ABSL_HAVE_ATTRIBUTE(no_sanitize_thread) -#define ABSL_ATTRIBUTE_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread)) +#if Y_ABSL_HAVE_ATTRIBUTE(no_sanitize_thread) +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread)) #else -#define ABSL_ATTRIBUTE_NO_SANITIZE_THREAD +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_THREAD #endif -// ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED +// Y_ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED // // Tells the UndefinedSanitizer to ignore a given function. Useful for cases // where certain behavior (eg. division by zero) is being used intentionally. // NOTE: GCC supports UndefinedBehaviorSanitizer(ubsan) since 4.9. // https://gcc.gnu.org/gcc-4.9/changes.html -#if ABSL_HAVE_ATTRIBUTE(no_sanitize_undefined) -#define ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED \ +#if Y_ABSL_HAVE_ATTRIBUTE(no_sanitize_undefined) +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED \ __attribute__((no_sanitize_undefined)) -#elif ABSL_HAVE_ATTRIBUTE(no_sanitize) -#define ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED \ +#elif Y_ABSL_HAVE_ATTRIBUTE(no_sanitize) +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED \ __attribute__((no_sanitize("undefined"))) #else -#define ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_UNDEFINED #endif -// ABSL_ATTRIBUTE_NO_SANITIZE_CFI +// Y_ABSL_ATTRIBUTE_NO_SANITIZE_CFI // // Tells the ControlFlowIntegrity sanitizer to not instrument a given function. // See https://clang.llvm.org/docs/ControlFlowIntegrity.html for details. -#if ABSL_HAVE_ATTRIBUTE(no_sanitize) -#define ABSL_ATTRIBUTE_NO_SANITIZE_CFI __attribute__((no_sanitize("cfi"))) +#if Y_ABSL_HAVE_ATTRIBUTE(no_sanitize) +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_CFI __attribute__((no_sanitize("cfi"))) #else -#define ABSL_ATTRIBUTE_NO_SANITIZE_CFI +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_CFI #endif -// ABSL_ATTRIBUTE_NO_SANITIZE_SAFESTACK +// Y_ABSL_ATTRIBUTE_NO_SANITIZE_SAFESTACK // // Tells the SafeStack to not instrument a given function. // See https://clang.llvm.org/docs/SafeStack.html for details. -#if ABSL_HAVE_ATTRIBUTE(no_sanitize) -#define ABSL_ATTRIBUTE_NO_SANITIZE_SAFESTACK \ +#if Y_ABSL_HAVE_ATTRIBUTE(no_sanitize) +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_SAFESTACK \ __attribute__((no_sanitize("safe-stack"))) #else -#define ABSL_ATTRIBUTE_NO_SANITIZE_SAFESTACK +#define Y_ABSL_ATTRIBUTE_NO_SANITIZE_SAFESTACK #endif -// ABSL_ATTRIBUTE_RETURNS_NONNULL +// Y_ABSL_ATTRIBUTE_RETURNS_NONNULL // // Tells the compiler that a particular function never returns a null pointer. -#if ABSL_HAVE_ATTRIBUTE(returns_nonnull) -#define ABSL_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull)) +#if Y_ABSL_HAVE_ATTRIBUTE(returns_nonnull) +#define Y_ABSL_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull)) #else -#define ABSL_ATTRIBUTE_RETURNS_NONNULL +#define Y_ABSL_ATTRIBUTE_RETURNS_NONNULL #endif -// ABSL_HAVE_ATTRIBUTE_SECTION +// Y_ABSL_HAVE_ATTRIBUTE_SECTION // // Indicates whether labeled sections are supported. Weak symbol support is // a prerequisite. Labeled sections are not supported on Darwin/iOS. -#ifdef ABSL_HAVE_ATTRIBUTE_SECTION -#error ABSL_HAVE_ATTRIBUTE_SECTION cannot be directly set -#elif (ABSL_HAVE_ATTRIBUTE(section) || \ +#ifdef Y_ABSL_HAVE_ATTRIBUTE_SECTION +#error Y_ABSL_HAVE_ATTRIBUTE_SECTION cannot be directly set +#elif (Y_ABSL_HAVE_ATTRIBUTE(section) || \ (defined(__GNUC__) && !defined(__clang__))) && \ - !defined(__APPLE__) && ABSL_HAVE_ATTRIBUTE_WEAK -#define ABSL_HAVE_ATTRIBUTE_SECTION 1 + !defined(__APPLE__) && Y_ABSL_HAVE_ATTRIBUTE_WEAK +#define Y_ABSL_HAVE_ATTRIBUTE_SECTION 1 -// ABSL_ATTRIBUTE_SECTION +// Y_ABSL_ATTRIBUTE_SECTION // // Tells the compiler/linker to put a given function into a section and define // `__start_ ## name` and `__stop_ ## name` symbols to bracket the section. // This functionality is supported by GNU linker. Any function annotated with -// `ABSL_ATTRIBUTE_SECTION` must not be inlined, or it will be placed into +// `Y_ABSL_ATTRIBUTE_SECTION` must not be inlined, or it will be placed into // whatever section its caller is placed into. // -#ifndef ABSL_ATTRIBUTE_SECTION -#define ABSL_ATTRIBUTE_SECTION(name) \ +#ifndef Y_ABSL_ATTRIBUTE_SECTION +#define Y_ABSL_ATTRIBUTE_SECTION(name) \ __attribute__((section(#name))) __attribute__((noinline)) #endif -// ABSL_ATTRIBUTE_SECTION_VARIABLE +// Y_ABSL_ATTRIBUTE_SECTION_VARIABLE // // Tells the compiler/linker to put a given variable into a section and define // `__start_ ## name` and `__stop_ ## name` symbols to bracket the section. // This functionality is supported by GNU linker. -#ifndef ABSL_ATTRIBUTE_SECTION_VARIABLE +#ifndef Y_ABSL_ATTRIBUTE_SECTION_VARIABLE #ifdef _AIX // __attribute__((section(#name))) on AIX is achived by using the `.csect` psudo // op which includes an additional integer as part of its syntax indcating // alignment. If data fall under different alignments then you might get a // compilation error indicating a `Section type conflict`. -#define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) +#define Y_ABSL_ATTRIBUTE_SECTION_VARIABLE(name) #else -#define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) __attribute__((section(#name))) +#define Y_ABSL_ATTRIBUTE_SECTION_VARIABLE(name) __attribute__((section(#name))) #endif #endif -// ABSL_DECLARE_ATTRIBUTE_SECTION_VARS +// Y_ABSL_DECLARE_ATTRIBUTE_SECTION_VARS // // A weak section declaration to be used as a global declaration -// for ABSL_ATTRIBUTE_SECTION_START|STOP(name) to compile and link -// even without functions with ABSL_ATTRIBUTE_SECTION(name). -// ABSL_DEFINE_ATTRIBUTE_SECTION should be in the exactly one file; it's +// for Y_ABSL_ATTRIBUTE_SECTION_START|STOP(name) to compile and link +// even without functions with Y_ABSL_ATTRIBUTE_SECTION(name). +// Y_ABSL_DEFINE_ATTRIBUTE_SECTION should be in the exactly one file; it's // a no-op on ELF but not on Mach-O. // -#ifndef ABSL_DECLARE_ATTRIBUTE_SECTION_VARS -#define ABSL_DECLARE_ATTRIBUTE_SECTION_VARS(name) \ - extern char __start_##name[] ABSL_ATTRIBUTE_WEAK; \ - extern char __stop_##name[] ABSL_ATTRIBUTE_WEAK +#ifndef Y_ABSL_DECLARE_ATTRIBUTE_SECTION_VARS +#define Y_ABSL_DECLARE_ATTRIBUTE_SECTION_VARS(name) \ + extern char __start_##name[] Y_ABSL_ATTRIBUTE_WEAK; \ + extern char __stop_##name[] Y_ABSL_ATTRIBUTE_WEAK #endif -#ifndef ABSL_DEFINE_ATTRIBUTE_SECTION_VARS -#define ABSL_INIT_ATTRIBUTE_SECTION_VARS(name) -#define ABSL_DEFINE_ATTRIBUTE_SECTION_VARS(name) +#ifndef Y_ABSL_DEFINE_ATTRIBUTE_SECTION_VARS +#define Y_ABSL_INIT_ATTRIBUTE_SECTION_VARS(name) +#define Y_ABSL_DEFINE_ATTRIBUTE_SECTION_VARS(name) #endif -// ABSL_ATTRIBUTE_SECTION_START +// Y_ABSL_ATTRIBUTE_SECTION_START // // Returns `void*` pointers to start/end of a section of code with -// functions having ABSL_ATTRIBUTE_SECTION(name). +// functions having Y_ABSL_ATTRIBUTE_SECTION(name). // Returns 0 if no such functions exist. -// One must ABSL_DECLARE_ATTRIBUTE_SECTION_VARS(name) for this to compile and +// One must Y_ABSL_DECLARE_ATTRIBUTE_SECTION_VARS(name) for this to compile and // link. // -#define ABSL_ATTRIBUTE_SECTION_START(name) \ +#define Y_ABSL_ATTRIBUTE_SECTION_START(name) \ (reinterpret_cast<void *>(__start_##name)) -#define ABSL_ATTRIBUTE_SECTION_STOP(name) \ +#define Y_ABSL_ATTRIBUTE_SECTION_STOP(name) \ (reinterpret_cast<void *>(__stop_##name)) -#else // !ABSL_HAVE_ATTRIBUTE_SECTION +#else // !Y_ABSL_HAVE_ATTRIBUTE_SECTION -#define ABSL_HAVE_ATTRIBUTE_SECTION 0 +#define Y_ABSL_HAVE_ATTRIBUTE_SECTION 0 // provide dummy definitions -#define ABSL_ATTRIBUTE_SECTION(name) -#define ABSL_ATTRIBUTE_SECTION_VARIABLE(name) -#define ABSL_INIT_ATTRIBUTE_SECTION_VARS(name) -#define ABSL_DEFINE_ATTRIBUTE_SECTION_VARS(name) -#define ABSL_DECLARE_ATTRIBUTE_SECTION_VARS(name) -#define ABSL_ATTRIBUTE_SECTION_START(name) (reinterpret_cast<void *>(0)) -#define ABSL_ATTRIBUTE_SECTION_STOP(name) (reinterpret_cast<void *>(0)) +#define Y_ABSL_ATTRIBUTE_SECTION(name) +#define Y_ABSL_ATTRIBUTE_SECTION_VARIABLE(name) +#define Y_ABSL_INIT_ATTRIBUTE_SECTION_VARS(name) +#define Y_ABSL_DEFINE_ATTRIBUTE_SECTION_VARS(name) +#define Y_ABSL_DECLARE_ATTRIBUTE_SECTION_VARS(name) +#define Y_ABSL_ATTRIBUTE_SECTION_START(name) (reinterpret_cast<void *>(0)) +#define Y_ABSL_ATTRIBUTE_SECTION_STOP(name) (reinterpret_cast<void *>(0)) -#endif // ABSL_ATTRIBUTE_SECTION +#endif // Y_ABSL_ATTRIBUTE_SECTION -// ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC +// Y_ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC // // Support for aligning the stack on 32-bit x86. -#if ABSL_HAVE_ATTRIBUTE(force_align_arg_pointer) || \ +#if Y_ABSL_HAVE_ATTRIBUTE(force_align_arg_pointer) || \ (defined(__GNUC__) && !defined(__clang__)) #if defined(__i386__) -#define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC \ +#define Y_ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC \ __attribute__((force_align_arg_pointer)) -#define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) +#define Y_ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) #elif defined(__x86_64__) -#define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (1) -#define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC +#define Y_ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (1) +#define Y_ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC #else // !__i386__ && !__x86_64 -#define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) -#define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC +#define Y_ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) +#define Y_ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC #endif // __i386__ #else -#define ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC -#define ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) +#define Y_ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC +#define Y_ABSL_REQUIRE_STACK_ALIGN_TRAMPOLINE (0) #endif -// ABSL_MUST_USE_RESULT +// Y_ABSL_MUST_USE_RESULT // // Tells the compiler to warn about unused results. // @@ -404,13 +404,13 @@ // declaration or definition. The compiler will warn if the return value from // such a function is unused: // -// ABSL_MUST_USE_RESULT Sprocket* AllocateSprocket(); +// Y_ABSL_MUST_USE_RESULT Sprocket* AllocateSprocket(); // AllocateSprocket(); // Triggers a warning. // // When annotating a class, it is equivalent to annotating every function which // returns an instance. // -// class ABSL_MUST_USE_RESULT Sprocket {}; +// class Y_ABSL_MUST_USE_RESULT Sprocket {}; // Sprocket(); // Triggers a warning. // // Sprocket MakeSprocket(); @@ -421,20 +421,20 @@ // Sprocket* SprocketPointer(); // SprocketPointer(); // Does *not* trigger a warning. // -// ABSL_MUST_USE_RESULT allows using cast-to-void to suppress the unused result +// Y_ABSL_MUST_USE_RESULT allows using cast-to-void to suppress the unused result // warning. For that, warn_unused_result is used only for clang but not for gcc. // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 // // Note: past advice was to place the macro after the argument list. -#if ABSL_HAVE_ATTRIBUTE(nodiscard) -#define ABSL_MUST_USE_RESULT [[nodiscard]] -#elif defined(__clang__) && ABSL_HAVE_ATTRIBUTE(warn_unused_result) -#define ABSL_MUST_USE_RESULT __attribute__((warn_unused_result)) +#if Y_ABSL_HAVE_ATTRIBUTE(nodiscard) +#define Y_ABSL_MUST_USE_RESULT [[nodiscard]] +#elif defined(__clang__) && Y_ABSL_HAVE_ATTRIBUTE(warn_unused_result) +#define Y_ABSL_MUST_USE_RESULT __attribute__((warn_unused_result)) #else -#define ABSL_MUST_USE_RESULT +#define Y_ABSL_MUST_USE_RESULT #endif -// ABSL_ATTRIBUTE_HOT, ABSL_ATTRIBUTE_COLD +// Y_ABSL_ATTRIBUTE_HOT, Y_ABSL_ATTRIBUTE_COLD // // Tells GCC that a function is hot or cold. GCC can use this information to // improve static analysis, i.e. a conditional branch to a cold function @@ -443,22 +443,22 @@ // // Example: // -// int foo() ABSL_ATTRIBUTE_HOT; -#if ABSL_HAVE_ATTRIBUTE(hot) || (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_ATTRIBUTE_HOT __attribute__((hot)) +// int foo() Y_ABSL_ATTRIBUTE_HOT; +#if Y_ABSL_HAVE_ATTRIBUTE(hot) || (defined(__GNUC__) && !defined(__clang__)) +#define Y_ABSL_ATTRIBUTE_HOT __attribute__((hot)) #else -#define ABSL_ATTRIBUTE_HOT +#define Y_ABSL_ATTRIBUTE_HOT #endif -#if ABSL_HAVE_ATTRIBUTE(cold) || (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_ATTRIBUTE_COLD __attribute__((cold)) +#if Y_ABSL_HAVE_ATTRIBUTE(cold) || (defined(__GNUC__) && !defined(__clang__)) +#define Y_ABSL_ATTRIBUTE_COLD __attribute__((cold)) #else -#define ABSL_ATTRIBUTE_COLD +#define Y_ABSL_ATTRIBUTE_COLD #endif -// ABSL_XRAY_ALWAYS_INSTRUMENT, ABSL_XRAY_NEVER_INSTRUMENT, ABSL_XRAY_LOG_ARGS +// Y_ABSL_XRAY_ALWAYS_INSTRUMENT, Y_ABSL_XRAY_NEVER_INSTRUMENT, Y_ABSL_XRAY_LOG_ARGS // -// We define the ABSL_XRAY_ALWAYS_INSTRUMENT and ABSL_XRAY_NEVER_INSTRUMENT +// We define the Y_ABSL_XRAY_ALWAYS_INSTRUMENT and Y_ABSL_XRAY_NEVER_INSTRUMENT // macro used as an attribute to mark functions that must always or never be // instrumented by XRay. Currently, this is only supported in Clang/LLVM. // @@ -486,29 +486,29 @@ // attributes in source take precedence over these special-case lists. // // To disable the XRay attributes at build-time, users may define -// ABSL_NO_XRAY_ATTRIBUTES. Do NOT define ABSL_NO_XRAY_ATTRIBUTES on specific +// Y_ABSL_NO_XRAY_ATTRIBUTES. Do NOT define Y_ABSL_NO_XRAY_ATTRIBUTES on specific // packages/targets, as this may lead to conflicting definitions of functions at // link-time. // // XRay isn't currently supported on Android: // https://github.com/android/ndk/issues/368 -#if ABSL_HAVE_CPP_ATTRIBUTE(clang::xray_always_instrument) && \ - !defined(ABSL_NO_XRAY_ATTRIBUTES) && !defined(__ANDROID__) -#define ABSL_XRAY_ALWAYS_INSTRUMENT [[clang::xray_always_instrument]] -#define ABSL_XRAY_NEVER_INSTRUMENT [[clang::xray_never_instrument]] -#if ABSL_HAVE_CPP_ATTRIBUTE(clang::xray_log_args) -#define ABSL_XRAY_LOG_ARGS(N) \ +#if Y_ABSL_HAVE_CPP_ATTRIBUTE(clang::xray_always_instrument) && \ + !defined(Y_ABSL_NO_XRAY_ATTRIBUTES) && !defined(__ANDROID__) +#define Y_ABSL_XRAY_ALWAYS_INSTRUMENT [[clang::xray_always_instrument]] +#define Y_ABSL_XRAY_NEVER_INSTRUMENT [[clang::xray_never_instrument]] +#if Y_ABSL_HAVE_CPP_ATTRIBUTE(clang::xray_log_args) +#define Y_ABSL_XRAY_LOG_ARGS(N) \ [[clang::xray_always_instrument, clang::xray_log_args(N)]] #else -#define ABSL_XRAY_LOG_ARGS(N) [[clang::xray_always_instrument]] +#define Y_ABSL_XRAY_LOG_ARGS(N) [[clang::xray_always_instrument]] #endif #else -#define ABSL_XRAY_ALWAYS_INSTRUMENT -#define ABSL_XRAY_NEVER_INSTRUMENT -#define ABSL_XRAY_LOG_ARGS(N) +#define Y_ABSL_XRAY_ALWAYS_INSTRUMENT +#define Y_ABSL_XRAY_NEVER_INSTRUMENT +#define Y_ABSL_XRAY_LOG_ARGS(N) #endif -// ABSL_ATTRIBUTE_REINITIALIZES +// Y_ABSL_ATTRIBUTE_REINITIALIZES // // Indicates that a member function reinitializes the entire object to a known // state, independent of the previous state of the object. @@ -516,17 +516,17 @@ // The clang-tidy check bugprone-use-after-move allows member functions marked // with this attribute to be called on objects that have been moved from; // without the attribute, this would result in a use-after-move warning. -#if ABSL_HAVE_CPP_ATTRIBUTE(clang::reinitializes) -#define ABSL_ATTRIBUTE_REINITIALIZES [[clang::reinitializes]] +#if Y_ABSL_HAVE_CPP_ATTRIBUTE(clang::reinitializes) +#define Y_ABSL_ATTRIBUTE_REINITIALIZES [[clang::reinitializes]] #else -#define ABSL_ATTRIBUTE_REINITIALIZES +#define Y_ABSL_ATTRIBUTE_REINITIALIZES #endif // ----------------------------------------------------------------------------- // Variable Attributes // ----------------------------------------------------------------------------- -// ABSL_ATTRIBUTE_UNUSED +// Y_ABSL_ATTRIBUTE_UNUSED // // Prevents the compiler from complaining about variables that appear unused. // @@ -536,24 +536,24 @@ // Due to differences in positioning requirements between the old, compiler // specific __attribute__ syntax and the now standard [[maybe_unused]], this // macro does not attempt to take advantage of '[[maybe_unused]]'. -#if ABSL_HAVE_ATTRIBUTE(unused) || (defined(__GNUC__) && !defined(__clang__)) -#undef ABSL_ATTRIBUTE_UNUSED -#define ABSL_ATTRIBUTE_UNUSED __attribute__((__unused__)) +#if Y_ABSL_HAVE_ATTRIBUTE(unused) || (defined(__GNUC__) && !defined(__clang__)) +#undef Y_ABSL_ATTRIBUTE_UNUSED +#define Y_ABSL_ATTRIBUTE_UNUSED __attribute__((__unused__)) #else -#define ABSL_ATTRIBUTE_UNUSED +#define Y_ABSL_ATTRIBUTE_UNUSED #endif -// ABSL_ATTRIBUTE_INITIAL_EXEC +// Y_ABSL_ATTRIBUTE_INITIAL_EXEC // // Tells the compiler to use "initial-exec" mode for a thread-local variable. // See http://people.redhat.com/drepper/tls.pdf for the gory details. -#if ABSL_HAVE_ATTRIBUTE(tls_model) || (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_ATTRIBUTE_INITIAL_EXEC __attribute__((tls_model("initial-exec"))) +#if Y_ABSL_HAVE_ATTRIBUTE(tls_model) || (defined(__GNUC__) && !defined(__clang__)) +#define Y_ABSL_ATTRIBUTE_INITIAL_EXEC __attribute__((tls_model("initial-exec"))) #else -#define ABSL_ATTRIBUTE_INITIAL_EXEC +#define Y_ABSL_ATTRIBUTE_INITIAL_EXEC #endif -// ABSL_ATTRIBUTE_PACKED +// Y_ABSL_ATTRIBUTE_PACKED // // Instructs the compiler not to use natural alignment for a tagged data // structure, but instead to reduce its alignment to 1. @@ -570,31 +570,31 @@ // structure. Instead, apply this attribute only to structure members that need // it. // -// When applying ABSL_ATTRIBUTE_PACKED only to specific structure members the +// When applying Y_ABSL_ATTRIBUTE_PACKED only to specific structure members the // natural alignment of structure members not annotated is preserved. Aligned // member accesses are faster than non-aligned member accesses even if the // targeted microprocessor supports non-aligned accesses. -#if ABSL_HAVE_ATTRIBUTE(packed) || (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_ATTRIBUTE_PACKED __attribute__((__packed__)) +#if Y_ABSL_HAVE_ATTRIBUTE(packed) || (defined(__GNUC__) && !defined(__clang__)) +#define Y_ABSL_ATTRIBUTE_PACKED __attribute__((__packed__)) #else -#define ABSL_ATTRIBUTE_PACKED +#define Y_ABSL_ATTRIBUTE_PACKED #endif -// ABSL_ATTRIBUTE_FUNC_ALIGN +// Y_ABSL_ATTRIBUTE_FUNC_ALIGN // // Tells the compiler to align the function start at least to certain // alignment boundary -#if ABSL_HAVE_ATTRIBUTE(aligned) || (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_ATTRIBUTE_FUNC_ALIGN(bytes) __attribute__((aligned(bytes))) +#if Y_ABSL_HAVE_ATTRIBUTE(aligned) || (defined(__GNUC__) && !defined(__clang__)) +#define Y_ABSL_ATTRIBUTE_FUNC_ALIGN(bytes) __attribute__((aligned(bytes))) #else -#define ABSL_ATTRIBUTE_FUNC_ALIGN(bytes) +#define Y_ABSL_ATTRIBUTE_FUNC_ALIGN(bytes) #endif -// ABSL_FALLTHROUGH_INTENDED +// Y_ABSL_FALLTHROUGH_INTENDED // // Annotates implicit fall-through between switch labels, allowing a case to // indicate intentional fallthrough and turn off warnings about any lack of a -// `break` statement. The ABSL_FALLTHROUGH_INTENDED macro should be followed by +// `break` statement. The Y_ABSL_FALLTHROUGH_INTENDED macro should be followed by // a semicolon and can be used in most places where `break` can, provided that // no statements exist between it and the next switch label. // @@ -605,7 +605,7 @@ // case 41: // if (truth_is_out_there) { // ++x; -// ABSL_FALLTHROUGH_INTENDED; // Use instead of/along with annotations +// Y_ABSL_FALLTHROUGH_INTENDED; // Use instead of/along with annotations // // in comments // } else { // return x; @@ -618,25 +618,25 @@ // clang documentation on language extensions for details: // https://clang.llvm.org/docs/AttributeReference.html#fallthrough-clang-fallthrough // -// When used with unsupported compilers, the ABSL_FALLTHROUGH_INTENDED macro has +// When used with unsupported compilers, the Y_ABSL_FALLTHROUGH_INTENDED macro has // no effect on diagnostics. In any case this macro has no effect on runtime // behavior and performance of code. -#ifdef ABSL_FALLTHROUGH_INTENDED -#error "ABSL_FALLTHROUGH_INTENDED should not be defined." -#elif ABSL_HAVE_CPP_ATTRIBUTE(fallthrough) -#define ABSL_FALLTHROUGH_INTENDED [[fallthrough]] -#elif ABSL_HAVE_CPP_ATTRIBUTE(clang::fallthrough) -#define ABSL_FALLTHROUGH_INTENDED [[clang::fallthrough]] -#elif ABSL_HAVE_CPP_ATTRIBUTE(gnu::fallthrough) -#define ABSL_FALLTHROUGH_INTENDED [[gnu::fallthrough]] +#ifdef Y_ABSL_FALLTHROUGH_INTENDED +#error "Y_ABSL_FALLTHROUGH_INTENDED should not be defined." +#elif Y_ABSL_HAVE_CPP_ATTRIBUTE(fallthrough) +#define Y_ABSL_FALLTHROUGH_INTENDED [[fallthrough]] +#elif Y_ABSL_HAVE_CPP_ATTRIBUTE(clang::fallthrough) +#define Y_ABSL_FALLTHROUGH_INTENDED [[clang::fallthrough]] +#elif Y_ABSL_HAVE_CPP_ATTRIBUTE(gnu::fallthrough) +#define Y_ABSL_FALLTHROUGH_INTENDED [[gnu::fallthrough]] #else -#define ABSL_FALLTHROUGH_INTENDED \ +#define Y_ABSL_FALLTHROUGH_INTENDED \ do { \ } while (0) #endif -// ABSL_DEPRECATED() +// Y_ABSL_DEPRECATED() // // Marks a deprecated class, struct, enum, function, method and variable // declarations. The macro argument is used as a custom diagnostic message (e.g. @@ -644,28 +644,28 @@ // // Examples: // -// class ABSL_DEPRECATED("Use Bar instead") Foo {...}; +// class Y_ABSL_DEPRECATED("Use Bar instead") Foo {...}; // -// ABSL_DEPRECATED("Use Baz() instead") void Bar() {...} +// Y_ABSL_DEPRECATED("Use Baz() instead") void Bar() {...} // // template <typename T> -// ABSL_DEPRECATED("Use DoThat() instead") +// Y_ABSL_DEPRECATED("Use DoThat() instead") // void DoThis(); // // Every usage of a deprecated entity will trigger a warning when compiled with // clang's `-Wdeprecated-declarations` option. This option is turned off by // default, but the warnings will be reported by clang-tidy. #if defined(__clang__) && defined(__cplusplus) && __cplusplus >= 201103L -#define ABSL_DEPRECATED(message) __attribute__((deprecated(message))) +#define Y_ABSL_DEPRECATED(message) __attribute__((deprecated(message))) #endif -#ifndef ABSL_DEPRECATED -#define ABSL_DEPRECATED(message) +#ifndef Y_ABSL_DEPRECATED +#define Y_ABSL_DEPRECATED(message) #endif -// ABSL_CONST_INIT +// Y_ABSL_CONST_INIT // -// A variable declaration annotated with the `ABSL_CONST_INIT` attribute will +// A variable declaration annotated with the `Y_ABSL_CONST_INIT` attribute will // not compile (on supported platforms) unless the variable has a constant // initializer. This is useful for variables with static and thread storage // duration, because it guarantees that they will not suffer from the so-called @@ -677,21 +677,21 @@ // // class MyClass { // public: -// ABSL_CONST_INIT static MyType my_var; +// Y_ABSL_CONST_INIT static MyType my_var; // }; // // MyType MyClass::my_var = MakeMyType(...); // // Note that this attribute is redundant if the variable is declared constexpr. -#if ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) -#define ABSL_CONST_INIT [[clang::require_constant_initialization]] +#if Y_ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) +#define Y_ABSL_CONST_INIT [[clang::require_constant_initialization]] #else -#define ABSL_CONST_INIT -#endif // ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) +#define Y_ABSL_CONST_INIT +#endif // Y_ABSL_HAVE_CPP_ATTRIBUTE(clang::require_constant_initialization) -// ABSL_ATTRIBUTE_PURE_FUNCTION +// Y_ABSL_ATTRIBUTE_PURE_FUNCTION // -// ABSL_ATTRIBUTE_PURE_FUNCTION is used to annotate declarations of "pure" +// Y_ABSL_ATTRIBUTE_PURE_FUNCTION is used to annotate declarations of "pure" // functions. A function is pure if its return value is only a function of its // arguments. The pure attribute prohibits a function from modifying the state // of the program that is observable by means other than inspecting the @@ -701,16 +701,16 @@ // // Example: // -// ABSL_ATTRIBUTE_PURE_FUNCTION int64_t ToInt64Milliseconds(Duration d); -#if ABSL_HAVE_CPP_ATTRIBUTE(gnu::pure) -#define ABSL_ATTRIBUTE_PURE_FUNCTION [[gnu::pure]] -#elif ABSL_HAVE_ATTRIBUTE(pure) -#define ABSL_ATTRIBUTE_PURE_FUNCTION __attribute__((pure)) +// Y_ABSL_ATTRIBUTE_PURE_FUNCTION int64_t ToInt64Milliseconds(Duration d); +#if Y_ABSL_HAVE_CPP_ATTRIBUTE(gnu::pure) +#define Y_ABSL_ATTRIBUTE_PURE_FUNCTION [[gnu::pure]] +#elif Y_ABSL_HAVE_ATTRIBUTE(pure) +#define Y_ABSL_ATTRIBUTE_PURE_FUNCTION __attribute__((pure)) #else -#define ABSL_ATTRIBUTE_PURE_FUNCTION +#define Y_ABSL_ATTRIBUTE_PURE_FUNCTION #endif -// ABSL_ATTRIBUTE_LIFETIME_BOUND indicates that a resource owned by a function +// Y_ABSL_ATTRIBUTE_LIFETIME_BOUND indicates that a resource owned by a function // parameter or implicit object parameter is retained by the return value of the // annotated function (or, for a parameter of a constructor, in the value of the // constructed object). This attribute causes warnings to be produced if a @@ -724,12 +724,12 @@ // // See also the upstream documentation: // https://clang.llvm.org/docs/AttributeReference.html#lifetimebound -#if ABSL_HAVE_CPP_ATTRIBUTE(clang::lifetimebound) -#define ABSL_ATTRIBUTE_LIFETIME_BOUND [[clang::lifetimebound]] -#elif ABSL_HAVE_ATTRIBUTE(lifetimebound) -#define ABSL_ATTRIBUTE_LIFETIME_BOUND __attribute__((lifetimebound)) +#if Y_ABSL_HAVE_CPP_ATTRIBUTE(clang::lifetimebound) +#define Y_ABSL_ATTRIBUTE_LIFETIME_BOUND [[clang::lifetimebound]] +#elif Y_ABSL_HAVE_ATTRIBUTE(lifetimebound) +#define Y_ABSL_ATTRIBUTE_LIFETIME_BOUND __attribute__((lifetimebound)) #else -#define ABSL_ATTRIBUTE_LIFETIME_BOUND +#define Y_ABSL_ATTRIBUTE_LIFETIME_BOUND #endif -#endif // ABSL_BASE_ATTRIBUTES_H_ +#endif // Y_ABSL_BASE_ATTRIBUTES_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h index 5d80e4e7ca..93239f29e4 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/call_once.h @@ -22,8 +22,8 @@ // fix, so that (for example) non-const references may be passed to the invoked // function. -#ifndef ABSL_BASE_CALL_ONCE_H_ -#define ABSL_BASE_CALL_ONCE_H_ +#ifndef Y_ABSL_BASE_CALL_ONCE_H_ +#define Y_ABSL_BASE_CALL_ONCE_H_ #include <algorithm> #include <atomic> @@ -41,7 +41,7 @@ #include "y_absl/base/port.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN class once_flag; @@ -143,7 +143,7 @@ enum { }; template <typename Callable, typename... Args> -ABSL_ATTRIBUTE_NOINLINE +Y_ABSL_ATTRIBUTE_NOINLINE void CallOnceImpl(std::atomic<uint32_t>* control, base_internal::SchedulingMode scheduling_mode, Callable&& fn, Args&&... args) { @@ -154,7 +154,7 @@ void CallOnceImpl(std::atomic<uint32_t>* control, old_control != kOnceRunning && old_control != kOnceWaiter && old_control != kOnceDone) { - ABSL_RAW_LOG(FATAL, "Unexpected value for control word: 0x%lx", + Y_ABSL_RAW_LOG(FATAL, "Unexpected value for control word: 0x%lx", static_cast<unsigned long>(old_control)); // NOLINT } } @@ -173,7 +173,7 @@ void CallOnceImpl(std::atomic<uint32_t>* control, uint32_t old_control = kOnceInit; if (control->compare_exchange_strong(old_control, kOnceRunning, std::memory_order_relaxed) || - base_internal::SpinLockWait(control, ABSL_ARRAYSIZE(trans), trans, + base_internal::SpinLockWait(control, Y_ABSL_ARRAYSIZE(trans), trans, scheduling_mode) == kOnceInit) { base_internal::invoke(std::forward<Callable>(fn), std::forward<Args>(args)...); @@ -193,7 +193,7 @@ template <typename Callable, typename... Args> void LowLevelCallOnce(y_absl::once_flag* flag, Callable&& fn, Args&&... args) { std::atomic<uint32_t>* once = base_internal::ControlWord(flag); uint32_t s = once->load(std::memory_order_acquire); - if (ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) { + if (Y_ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) { base_internal::CallOnceImpl(once, base_internal::SCHEDULE_KERNEL_ONLY, std::forward<Callable>(fn), std::forward<Args>(args)...); @@ -206,14 +206,14 @@ template <typename Callable, typename... Args> void call_once(y_absl::once_flag& flag, Callable&& fn, Args&&... args) { std::atomic<uint32_t>* once = base_internal::ControlWord(&flag); uint32_t s = once->load(std::memory_order_acquire); - if (ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) { + if (Y_ABSL_PREDICT_FALSE(s != base_internal::kOnceDone)) { base_internal::CallOnceImpl( once, base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL, std::forward<Callable>(fn), std::forward<Args>(args)...); } } -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_CALL_ONCE_H_ +#endif // Y_ABSL_BASE_CALL_ONCE_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/casts.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/casts.h index 6270ede21e..4ea832f441 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/casts.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/casts.h @@ -21,8 +21,8 @@ // the standard casts provided in the C++ standard. As with all cast operations, // use these with caution and only if alternatives do not exist. -#ifndef ABSL_BASE_CASTS_H_ -#define ABSL_BASE_CASTS_H_ +#ifndef Y_ABSL_BASE_CASTS_H_ +#define Y_ABSL_BASE_CASTS_H_ #include <cstring> #include <memory> @@ -34,7 +34,7 @@ #include "y_absl/meta/type_traits.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace internal_casts { @@ -168,7 +168,7 @@ template < typename std::enable_if< !internal_casts::is_bitcastable<Dest, Source>::value, int>::type = 0> -ABSL_DEPRECATED( +Y_ABSL_DEPRECATED( "y_absl::bit_cast type requirements were violated. Update the types " "being used such that they are the same size and are both " "TriviallyCopyable.") @@ -181,7 +181,7 @@ inline Dest bit_cast(const Source& source) { return dest; } -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_CASTS_H_ +#endif // Y_ABSL_BASE_CASTS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h index 162843aa00..cb0bf305c9 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/config.h @@ -29,24 +29,24 @@ // Example: // // Suppose a programmer wants to write a program that uses the 'mmap()' system -// call. The Abseil macro for that feature (`ABSL_HAVE_MMAP`) allows you to +// call. The Abseil macro for that feature (`Y_ABSL_HAVE_MMAP`) allows you to // selectively include the `mmap.h` header and bracket code using that feature // in the macro: // // #include "y_absl/base/config.h" // -// #ifdef ABSL_HAVE_MMAP +// #ifdef Y_ABSL_HAVE_MMAP // #include "sys/mman.h" -// #endif //ABSL_HAVE_MMAP +// #endif //Y_ABSL_HAVE_MMAP // // ... -// #ifdef ABSL_HAVE_MMAP +// #ifdef Y_ABSL_HAVE_MMAP // void *ptr = mmap(...); // ... -// #endif // ABSL_HAVE_MMAP +// #endif // Y_ABSL_HAVE_MMAP -#ifndef ABSL_BASE_CONFIG_H_ -#define ABSL_BASE_CONFIG_H_ +#ifndef Y_ABSL_BASE_CONFIG_H_ +#define Y_ABSL_BASE_CONFIG_H_ // Included for the __GLIBC__ macro (or similar macros on other systems). #include <limits.h> @@ -67,12 +67,12 @@ #include "y_absl/base/policy_checks.h" // Abseil long-term support (LTS) releases will define -// `ABSL_LTS_RELEASE_VERSION` to the integer representing the date string of the -// LTS release version, and will define `ABSL_LTS_RELEASE_PATCH_LEVEL` to the +// `Y_ABSL_LTS_RELEASE_VERSION` to the integer representing the date string of the +// LTS release version, and will define `Y_ABSL_LTS_RELEASE_PATCH_LEVEL` to the // integer representing the patch-level for that release. // // For example, for LTS release version "20300401.2", this would give us -// ABSL_LTS_RELEASE_VERSION == 20300401 && ABSL_LTS_RELEASE_PATCH_LEVEL == 2 +// Y_ABSL_LTS_RELEASE_VERSION == 20300401 && Y_ABSL_LTS_RELEASE_PATCH_LEVEL == 2 // // These symbols will not be defined in non-LTS code. // @@ -80,11 +80,11 @@ // these symbols to assert a minimum version requirement, we recommend you do it // as // -// #if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20300401 +// #if defined(Y_ABSL_LTS_RELEASE_VERSION) && Y_ABSL_LTS_RELEASE_VERSION < 20300401 // #error Project foo requires Abseil LTS version >= 20300401 // #endif // -// The `defined(ABSL_LTS_RELEASE_VERSION)` part of the check excludes +// The `defined(Y_ABSL_LTS_RELEASE_VERSION)` part of the check excludes // live-at-head clients from the minimum version assertion. // // See https://abseil.io/about/releases for more information on Abseil release @@ -92,18 +92,18 @@ // // LTS releases can be obtained from // https://github.com/abseil/abseil-cpp/releases. -#define ABSL_LTS_RELEASE_VERSION 20211102 -#define ABSL_LTS_RELEASE_PATCH_LEVEL 0 +#define Y_ABSL_LTS_RELEASE_VERSION 20211102 +#define Y_ABSL_LTS_RELEASE_PATCH_LEVEL 0 // Helper macro to convert a CPP variable to a string literal. -#define ABSL_INTERNAL_DO_TOKEN_STR(x) #x -#define ABSL_INTERNAL_TOKEN_STR(x) ABSL_INTERNAL_DO_TOKEN_STR(x) +#define Y_ABSL_INTERNAL_DO_TOKEN_STR(x) #x +#define Y_ABSL_INTERNAL_TOKEN_STR(x) Y_ABSL_INTERNAL_DO_TOKEN_STR(x) // ----------------------------------------------------------------------------- // Abseil namespace annotations // ----------------------------------------------------------------------------- -// ABSL_NAMESPACE_BEGIN/ABSL_NAMESPACE_END +// Y_ABSL_NAMESPACE_BEGIN/Y_ABSL_NAMESPACE_END // // An annotation placed at the beginning/end of each `namespace y_absl` scope. // This is used to inject an inline namespace. @@ -111,11 +111,11 @@ // The proper way to write Abseil code in the `y_absl` namespace is: // // namespace y_absl { -// ABSL_NAMESPACE_BEGIN +// Y_ABSL_NAMESPACE_BEGIN // // void Foo(); // y_absl::Foo(). // -// ABSL_NAMESPACE_END +// Y_ABSL_NAMESPACE_END // } // namespace y_absl // // Users of Abseil should not use these macros, because users of Abseil should @@ -123,43 +123,43 @@ // not support forward declarations of its own types, nor does it support // user-provided specialization of Abseil templates. Code that violates these // rules may be broken without warning.) -#if !defined(ABSL_OPTION_USE_INLINE_NAMESPACE) || \ - !defined(ABSL_OPTION_INLINE_NAMESPACE_NAME) +#if !defined(Y_ABSL_OPTION_USE_INLINE_NAMESPACE) || \ + !defined(Y_ABSL_OPTION_INLINE_NAMESPACE_NAME) #error options.h is misconfigured. #endif -// Check that ABSL_OPTION_INLINE_NAMESPACE_NAME is neither "head" nor "" -#if defined(__cplusplus) && ABSL_OPTION_USE_INLINE_NAMESPACE == 1 +// Check that Y_ABSL_OPTION_INLINE_NAMESPACE_NAME is neither "head" nor "" +#if defined(__cplusplus) && Y_ABSL_OPTION_USE_INLINE_NAMESPACE == 1 -#define ABSL_INTERNAL_INLINE_NAMESPACE_STR \ - ABSL_INTERNAL_TOKEN_STR(ABSL_OPTION_INLINE_NAMESPACE_NAME) +#define Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR \ + Y_ABSL_INTERNAL_TOKEN_STR(Y_ABSL_OPTION_INLINE_NAMESPACE_NAME) -static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != '\0', - "options.h misconfigured: ABSL_OPTION_INLINE_NAMESPACE_NAME must " +static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != '\0', + "options.h misconfigured: Y_ABSL_OPTION_INLINE_NAMESPACE_NAME must " "not be empty."); -static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || - ABSL_INTERNAL_INLINE_NAMESPACE_STR[1] != 'e' || - ABSL_INTERNAL_INLINE_NAMESPACE_STR[2] != 'a' || - ABSL_INTERNAL_INLINE_NAMESPACE_STR[3] != 'd' || - ABSL_INTERNAL_INLINE_NAMESPACE_STR[4] != '\0', - "options.h misconfigured: ABSL_OPTION_INLINE_NAMESPACE_NAME must " +static_assert(Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || + Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[1] != 'e' || + Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[2] != 'a' || + Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[3] != 'd' || + Y_ABSL_INTERNAL_INLINE_NAMESPACE_STR[4] != '\0', + "options.h misconfigured: Y_ABSL_OPTION_INLINE_NAMESPACE_NAME must " "be changed to a new, unique identifier name."); #endif -#if ABSL_OPTION_USE_INLINE_NAMESPACE == 0 -#define ABSL_NAMESPACE_BEGIN -#define ABSL_NAMESPACE_END -#define ABSL_INTERNAL_C_SYMBOL(x) x -#elif ABSL_OPTION_USE_INLINE_NAMESPACE == 1 -#define ABSL_NAMESPACE_BEGIN \ - inline namespace ABSL_OPTION_INLINE_NAMESPACE_NAME { -#define ABSL_NAMESPACE_END } -#define ABSL_INTERNAL_C_SYMBOL_HELPER_2(x, v) x##_##v -#define ABSL_INTERNAL_C_SYMBOL_HELPER_1(x, v) \ - ABSL_INTERNAL_C_SYMBOL_HELPER_2(x, v) -#define ABSL_INTERNAL_C_SYMBOL(x) \ - ABSL_INTERNAL_C_SYMBOL_HELPER_1(x, ABSL_OPTION_INLINE_NAMESPACE_NAME) +#if Y_ABSL_OPTION_USE_INLINE_NAMESPACE == 0 +#define Y_ABSL_NAMESPACE_BEGIN +#define Y_ABSL_NAMESPACE_END +#define Y_ABSL_INTERNAL_C_SYMBOL(x) x +#elif Y_ABSL_OPTION_USE_INLINE_NAMESPACE == 1 +#define Y_ABSL_NAMESPACE_BEGIN \ + inline namespace Y_ABSL_OPTION_INLINE_NAMESPACE_NAME { +#define Y_ABSL_NAMESPACE_END } +#define Y_ABSL_INTERNAL_C_SYMBOL_HELPER_2(x, v) x##_##v +#define Y_ABSL_INTERNAL_C_SYMBOL_HELPER_1(x, v) \ + Y_ABSL_INTERNAL_C_SYMBOL_HELPER_2(x, v) +#define Y_ABSL_INTERNAL_C_SYMBOL(x) \ + Y_ABSL_INTERNAL_C_SYMBOL_HELPER_1(x, Y_ABSL_OPTION_INLINE_NAMESPACE_NAME) #else #error options.h is misconfigured. #endif @@ -168,7 +168,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || // Compiler Feature Checks // ----------------------------------------------------------------------------- -// ABSL_HAVE_BUILTIN() +// Y_ABSL_HAVE_BUILTIN() // // Checks whether the compiler supports a Clang Feature Checking Macro, and if // so, checks whether it supports the provided builtin function "x" where x @@ -178,106 +178,106 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || // Note: Use this macro to avoid an extra level of #ifdef __has_builtin check. // http://releases.llvm.org/3.3/tools/clang/docs/LanguageExtensions.html #ifdef __has_builtin -#define ABSL_HAVE_BUILTIN(x) __has_builtin(x) +#define Y_ABSL_HAVE_BUILTIN(x) __has_builtin(x) #else -#define ABSL_HAVE_BUILTIN(x) 0 +#define Y_ABSL_HAVE_BUILTIN(x) 0 #endif #if defined(__is_identifier) -#define ABSL_INTERNAL_HAS_KEYWORD(x) !(__is_identifier(x)) +#define Y_ABSL_INTERNAL_HAS_KEYWORD(x) !(__is_identifier(x)) #else -#define ABSL_INTERNAL_HAS_KEYWORD(x) 0 +#define Y_ABSL_INTERNAL_HAS_KEYWORD(x) 0 #endif #ifdef __has_feature -#define ABSL_HAVE_FEATURE(f) __has_feature(f) +#define Y_ABSL_HAVE_FEATURE(f) __has_feature(f) #else -#define ABSL_HAVE_FEATURE(f) 0 +#define Y_ABSL_HAVE_FEATURE(f) 0 #endif // Portable check for GCC minimum version: // https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html #if defined(__GNUC__) && defined(__GNUC_MINOR__) -#define ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(x, y) \ +#define Y_ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(x, y) \ (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y)) #else -#define ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(x, y) 0 +#define Y_ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(x, y) 0 #endif #if defined(__clang__) && defined(__clang_major__) && defined(__clang_minor__) -#define ABSL_INTERNAL_HAVE_MIN_CLANG_VERSION(x, y) \ +#define Y_ABSL_INTERNAL_HAVE_MIN_CLANG_VERSION(x, y) \ (__clang_major__ > (x) || __clang_major__ == (x) && __clang_minor__ >= (y)) #else -#define ABSL_INTERNAL_HAVE_MIN_CLANG_VERSION(x, y) 0 +#define Y_ABSL_INTERNAL_HAVE_MIN_CLANG_VERSION(x, y) 0 #endif -// ABSL_HAVE_TLS is defined to 1 when __thread should be supported. +// Y_ABSL_HAVE_TLS is defined to 1 when __thread should be supported. // We assume __thread is supported on Linux when compiled with Clang or compiled // against libstdc++ with _GLIBCXX_HAVE_TLS defined. -#ifdef ABSL_HAVE_TLS -#error ABSL_HAVE_TLS cannot be directly set +#ifdef Y_ABSL_HAVE_TLS +#error Y_ABSL_HAVE_TLS cannot be directly set #elif defined(__linux__) && (defined(__clang__) || defined(_GLIBCXX_HAVE_TLS)) -#define ABSL_HAVE_TLS 1 +#define Y_ABSL_HAVE_TLS 1 #endif -// ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE +// Y_ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE // // Checks whether `std::is_trivially_destructible<T>` is supported. // // Notes: All supported compilers using libc++ support this feature, as does // gcc >= 4.8.1 using libstdc++, and Visual Studio. -#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE -#error ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE cannot be directly set +#ifdef Y_ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE +#error Y_ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE cannot be directly set #elif defined(_LIBCPP_VERSION) || defined(_MSC_VER) || \ (!defined(__clang__) && defined(__GLIBCXX__) && \ - ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(4, 8)) -#define ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE 1 + Y_ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(4, 8)) +#define Y_ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE 1 #endif -// ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE +// Y_ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE // // Checks whether `std::is_trivially_default_constructible<T>` and // `std::is_trivially_copy_constructible<T>` are supported. -// ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE +// Y_ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE // // Checks whether `std::is_trivially_copy_assignable<T>` is supported. // Notes: Clang with libc++ supports these features, as does gcc >= 7.4 with // libstdc++, or gcc >= 8.2 with libc++, and Visual Studio (but not NVCC). -#if defined(ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE) -#error ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE cannot be directly set -#elif defined(ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE) -#error ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE cannot directly set +#if defined(Y_ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE) +#error Y_ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE cannot be directly set +#elif defined(Y_ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE) +#error Y_ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE cannot directly set #elif (defined(__clang__) && defined(_LIBCPP_VERSION)) || \ (!defined(__clang__) && \ - ((ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(7, 4) && defined(__GLIBCXX__)) || \ - (ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(8, 2) && \ + ((Y_ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(7, 4) && defined(__GLIBCXX__)) || \ + (Y_ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(8, 2) && \ defined(_LIBCPP_VERSION)))) || \ (defined(_MSC_VER) && !defined(__NVCC__)) -#define ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE 1 -#define ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE 1 +#define Y_ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE 1 +#define Y_ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE 1 #endif -// ABSL_HAVE_SOURCE_LOCATION_CURRENT +// Y_ABSL_HAVE_SOURCE_LOCATION_CURRENT // // Indicates whether `y_absl::SourceLocation::current()` will return useful // information in some contexts. -#ifndef ABSL_HAVE_SOURCE_LOCATION_CURRENT -#if ABSL_INTERNAL_HAS_KEYWORD(__builtin_LINE) && \ - ABSL_INTERNAL_HAS_KEYWORD(__builtin_FILE) -#define ABSL_HAVE_SOURCE_LOCATION_CURRENT 1 -#elif ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(5, 0) -#define ABSL_HAVE_SOURCE_LOCATION_CURRENT 1 +#ifndef Y_ABSL_HAVE_SOURCE_LOCATION_CURRENT +#if Y_ABSL_INTERNAL_HAS_KEYWORD(__builtin_LINE) && \ + Y_ABSL_INTERNAL_HAS_KEYWORD(__builtin_FILE) +#define Y_ABSL_HAVE_SOURCE_LOCATION_CURRENT 1 +#elif Y_ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(5, 0) +#define Y_ABSL_HAVE_SOURCE_LOCATION_CURRENT 1 #endif #endif -// ABSL_HAVE_THREAD_LOCAL +// Y_ABSL_HAVE_THREAD_LOCAL // // Checks whether C++11's `thread_local` storage duration specifier is // supported. -#ifdef ABSL_HAVE_THREAD_LOCAL -#error ABSL_HAVE_THREAD_LOCAL cannot be directly set +#ifdef Y_ABSL_HAVE_THREAD_LOCAL +#error Y_ABSL_HAVE_THREAD_LOCAL cannot be directly set #elif defined(__APPLE__) // Notes: // * Xcode's clang did not support `thread_local` until version 8, and @@ -285,14 +285,14 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || // * Xcode 9.3 started disallowing `thread_local` for 32-bit iOS simulator // targeting iOS 9.x. // * Xcode 10 moves the deployment target check for iOS < 9.0 to link time -// making ABSL_HAVE_FEATURE unreliable there. +// making Y_ABSL_HAVE_FEATURE unreliable there. // -#if ABSL_HAVE_FEATURE(cxx_thread_local) && \ +#if Y_ABSL_HAVE_FEATURE(cxx_thread_local) && \ !(TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0) -#define ABSL_HAVE_THREAD_LOCAL 1 +#define Y_ABSL_HAVE_THREAD_LOCAL 1 #endif #else // !defined(__APPLE__) -#define ABSL_HAVE_THREAD_LOCAL 1 +#define Y_ABSL_HAVE_THREAD_LOCAL 1 #endif // There are platforms for which TLS should not be used even though the compiler @@ -314,12 +314,12 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || #if defined(__ANDROID__) && defined(__clang__) && defined(__NDK_MAJOR__) && \ defined(__NDK_MINOR__) && \ ((__NDK_MAJOR__ < 12) || ((__NDK_MAJOR__ == 12) && (__NDK_MINOR__ < 1))) -#undef ABSL_HAVE_TLS -#undef ABSL_HAVE_THREAD_LOCAL +#undef Y_ABSL_HAVE_TLS +#undef Y_ABSL_HAVE_THREAD_LOCAL #endif #endif // defined(__ANDROID__) && defined(__clang__) -// ABSL_HAVE_INTRINSIC_INT128 +// Y_ABSL_HAVE_INTRINSIC_INT128 // // Checks whether the __int128 compiler extension for a 128-bit integral type is // supported. @@ -332,55 +332,55 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || // * On Nvidia's nvcc: // * nvcc also defines __GNUC__ and __SIZEOF_INT128__, but not all versions // actually support __int128. -#ifdef ABSL_HAVE_INTRINSIC_INT128 -#error ABSL_HAVE_INTRINSIC_INT128 cannot be directly set +#ifdef Y_ABSL_HAVE_INTRINSIC_INT128 +#error Y_ABSL_HAVE_INTRINSIC_INT128 cannot be directly set #elif defined(__SIZEOF_INT128__) #if (defined(__clang__) && !defined(_WIN32)) || \ (defined(__CUDACC__) && __CUDACC_VER_MAJOR__ >= 9) || \ (defined(__GNUC__) && !defined(__clang__) && !defined(__CUDACC__)) -#define ABSL_HAVE_INTRINSIC_INT128 1 +#define Y_ABSL_HAVE_INTRINSIC_INT128 1 #elif defined(__CUDACC__) // __CUDACC_VER__ is a full version number before CUDA 9, and is defined to a // string explaining that it has been removed starting with CUDA 9. We use // nested #ifs because there is no short-circuiting in the preprocessor. // NOTE: `__CUDACC__` could be undefined while `__CUDACC_VER__` is defined. #if __CUDACC_VER__ >= 70000 -#define ABSL_HAVE_INTRINSIC_INT128 1 +#define Y_ABSL_HAVE_INTRINSIC_INT128 1 #endif // __CUDACC_VER__ >= 70000 #endif // defined(__CUDACC__) -#endif // ABSL_HAVE_INTRINSIC_INT128 +#endif // Y_ABSL_HAVE_INTRINSIC_INT128 -// ABSL_HAVE_EXCEPTIONS +// Y_ABSL_HAVE_EXCEPTIONS // // Checks whether the compiler both supports and enables exceptions. Many // compilers support a "no exceptions" mode that disables exceptions. // -// Generally, when ABSL_HAVE_EXCEPTIONS is not defined: +// Generally, when Y_ABSL_HAVE_EXCEPTIONS is not defined: // // * Code using `throw` and `try` may not compile. // * The `noexcept` specifier will still compile and behave as normal. // * The `noexcept` operator may still return `false`. // // For further details, consult the compiler's documentation. -#ifdef ABSL_HAVE_EXCEPTIONS -#error ABSL_HAVE_EXCEPTIONS cannot be directly set. -#elif ABSL_INTERNAL_HAVE_MIN_CLANG_VERSION(3, 6) +#ifdef Y_ABSL_HAVE_EXCEPTIONS +#error Y_ABSL_HAVE_EXCEPTIONS cannot be directly set. +#elif Y_ABSL_INTERNAL_HAVE_MIN_CLANG_VERSION(3, 6) // Clang >= 3.6 -#if ABSL_HAVE_FEATURE(cxx_exceptions) -#define ABSL_HAVE_EXCEPTIONS 1 -#endif // ABSL_HAVE_FEATURE(cxx_exceptions) +#if Y_ABSL_HAVE_FEATURE(cxx_exceptions) +#define Y_ABSL_HAVE_EXCEPTIONS 1 +#endif // Y_ABSL_HAVE_FEATURE(cxx_exceptions) #elif defined(__clang__) // Clang < 3.6 // http://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html#the-exceptions-macro -#if defined(__EXCEPTIONS) && ABSL_HAVE_FEATURE(cxx_exceptions) -#define ABSL_HAVE_EXCEPTIONS 1 -#endif // defined(__EXCEPTIONS) && ABSL_HAVE_FEATURE(cxx_exceptions) +#if defined(__EXCEPTIONS) && Y_ABSL_HAVE_FEATURE(cxx_exceptions) +#define Y_ABSL_HAVE_EXCEPTIONS 1 +#endif // defined(__EXCEPTIONS) && Y_ABSL_HAVE_FEATURE(cxx_exceptions) // Handle remaining special cases and default to exceptions being supported. #elif !(defined(__GNUC__) && (__GNUC__ < 5) && !defined(__EXCEPTIONS)) && \ - !(ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(5, 0) && \ + !(Y_ABSL_INTERNAL_HAVE_MIN_GNUC_VERSION(5, 0) && \ !defined(__cpp_exceptions)) && \ !(defined(_MSC_VER) && !defined(_CPPUNWIND)) -#define ABSL_HAVE_EXCEPTIONS 1 +#define Y_ABSL_HAVE_EXCEPTIONS 1 #endif // ----------------------------------------------------------------------------- @@ -404,51 +404,51 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || // Note that since Android defines both __ANDROID__ and __linux__, one // may probe for either Linux or Android by simply testing for __linux__. -// ABSL_HAVE_MMAP +// Y_ABSL_HAVE_MMAP // // Checks whether the platform has an mmap(2) implementation as defined in // POSIX.1-2001. -#ifdef ABSL_HAVE_MMAP -#error ABSL_HAVE_MMAP cannot be directly set +#ifdef Y_ABSL_HAVE_MMAP +#error Y_ABSL_HAVE_MMAP cannot be directly set #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ defined(_AIX) || defined(__ros__) || defined(__native_client__) || \ defined(__asmjs__) || defined(__wasm__) || defined(__Fuchsia__) || \ defined(__sun) || defined(__ASYLO__) || defined(__myriad2__) || \ defined(__HAIKU__) -#define ABSL_HAVE_MMAP 1 +#define Y_ABSL_HAVE_MMAP 1 #endif -// ABSL_HAVE_PTHREAD_GETSCHEDPARAM +// Y_ABSL_HAVE_PTHREAD_GETSCHEDPARAM // // Checks whether the platform implements the pthread_(get|set)schedparam(3) // functions as defined in POSIX.1-2001. -#ifdef ABSL_HAVE_PTHREAD_GETSCHEDPARAM -#error ABSL_HAVE_PTHREAD_GETSCHEDPARAM cannot be directly set +#ifdef Y_ABSL_HAVE_PTHREAD_GETSCHEDPARAM +#error Y_ABSL_HAVE_PTHREAD_GETSCHEDPARAM cannot be directly set #elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ defined(_AIX) || defined(__ros__) -#define ABSL_HAVE_PTHREAD_GETSCHEDPARAM 1 +#define Y_ABSL_HAVE_PTHREAD_GETSCHEDPARAM 1 #endif -// ABSL_HAVE_SCHED_GETCPU +// Y_ABSL_HAVE_SCHED_GETCPU // // Checks whether sched_getcpu is available. -#ifdef ABSL_HAVE_SCHED_GETCPU -#error ABSL_HAVE_SCHED_GETCPU cannot be directly set +#ifdef Y_ABSL_HAVE_SCHED_GETCPU +#error Y_ABSL_HAVE_SCHED_GETCPU cannot be directly set #elif defined(__linux__) -#define ABSL_HAVE_SCHED_GETCPU 1 +#define Y_ABSL_HAVE_SCHED_GETCPU 1 #endif -// ABSL_HAVE_SCHED_YIELD +// Y_ABSL_HAVE_SCHED_YIELD // // Checks whether the platform implements sched_yield(2) as defined in // POSIX.1-2001. -#ifdef ABSL_HAVE_SCHED_YIELD -#error ABSL_HAVE_SCHED_YIELD cannot be directly set +#ifdef Y_ABSL_HAVE_SCHED_YIELD +#error Y_ABSL_HAVE_SCHED_YIELD cannot be directly set #elif defined(__linux__) || defined(__ros__) || defined(__native_client__) -#define ABSL_HAVE_SCHED_YIELD 1 +#define Y_ABSL_HAVE_SCHED_YIELD 1 #endif -// ABSL_HAVE_SEMAPHORE_H +// Y_ABSL_HAVE_SEMAPHORE_H // // Checks whether the platform supports the <semaphore.h> header and sem_init(3) // family of functions as standardized in POSIX.1-2001. @@ -457,24 +457,24 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || // explicitly deprecated and will cause build failures if enabled for those // platforms. We side-step the issue by not defining it here for Apple // platforms. -#ifdef ABSL_HAVE_SEMAPHORE_H -#error ABSL_HAVE_SEMAPHORE_H cannot be directly set +#ifdef Y_ABSL_HAVE_SEMAPHORE_H +#error Y_ABSL_HAVE_SEMAPHORE_H cannot be directly set #elif defined(__linux__) || defined(__ros__) -#define ABSL_HAVE_SEMAPHORE_H 1 +#define Y_ABSL_HAVE_SEMAPHORE_H 1 #endif -// ABSL_HAVE_ALARM +// Y_ABSL_HAVE_ALARM // // Checks whether the platform supports the <signal.h> header and alarm(2) // function as standardized in POSIX.1-2001. -#ifdef ABSL_HAVE_ALARM -#error ABSL_HAVE_ALARM cannot be directly set +#ifdef Y_ABSL_HAVE_ALARM +#error Y_ABSL_HAVE_ALARM cannot be directly set #elif defined(__GOOGLE_GRTE_VERSION__) // feature tests for Google's GRTE -#define ABSL_HAVE_ALARM 1 +#define Y_ABSL_HAVE_ALARM 1 #elif defined(__GLIBC__) // feature test for glibc -#define ABSL_HAVE_ALARM 1 +#define Y_ABSL_HAVE_ALARM 1 #elif defined(_MSC_VER) // feature tests for Microsoft's library #elif defined(__MINGW32__) @@ -489,11 +489,11 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || #elif defined(__native_client__) #else // other standard libraries -#define ABSL_HAVE_ALARM 1 +#define Y_ABSL_HAVE_ALARM 1 #endif -// ABSL_IS_LITTLE_ENDIAN -// ABSL_IS_BIG_ENDIAN +// Y_ABSL_IS_LITTLE_ENDIAN +// Y_ABSL_IS_BIG_ENDIAN // // Checks the endianness of the platform. // @@ -501,21 +501,21 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || // Clang (since 3.2); see // https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html. // Otherwise, if _WIN32, assume little endian. Otherwise, bail with an error. -#if defined(ABSL_IS_BIG_ENDIAN) -#error "ABSL_IS_BIG_ENDIAN cannot be directly set." +#if defined(Y_ABSL_IS_BIG_ENDIAN) +#error "Y_ABSL_IS_BIG_ENDIAN cannot be directly set." #endif -#if defined(ABSL_IS_LITTLE_ENDIAN) -#error "ABSL_IS_LITTLE_ENDIAN cannot be directly set." +#if defined(Y_ABSL_IS_LITTLE_ENDIAN) +#error "Y_ABSL_IS_LITTLE_ENDIAN cannot be directly set." #endif #if (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) -#define ABSL_IS_LITTLE_ENDIAN 1 +#define Y_ABSL_IS_LITTLE_ENDIAN 1 #elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \ __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define ABSL_IS_BIG_ENDIAN 1 +#define Y_ABSL_IS_BIG_ENDIAN 1 #elif defined(_WIN32) -#define ABSL_IS_LITTLE_ENDIAN 1 +#define Y_ABSL_IS_LITTLE_ENDIAN 1 #else #error "y_absl endian detection needs to be set up for your compiler" #endif @@ -536,61 +536,61 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 50000) || \ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && \ __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 120000)) -#define ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 1 +#define Y_ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 1 #else -#define ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 0 +#define Y_ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 0 #endif -// ABSL_HAVE_STD_ANY +// Y_ABSL_HAVE_STD_ANY // // Checks whether C++17 std::any is available by checking whether <any> exists. -#ifdef ABSL_HAVE_STD_ANY -#error "ABSL_HAVE_STD_ANY cannot be directly set." +#ifdef Y_ABSL_HAVE_STD_ANY +#error "Y_ABSL_HAVE_STD_ANY cannot be directly set." #endif #ifdef __has_include #if __has_include(<any>) && defined(__cplusplus) && __cplusplus >= 201703L && \ - !ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE -#define ABSL_HAVE_STD_ANY 1 + !Y_ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE +#define Y_ABSL_HAVE_STD_ANY 1 #endif #endif -// ABSL_HAVE_STD_OPTIONAL +// Y_ABSL_HAVE_STD_OPTIONAL // // Checks whether C++17 std::optional is available. -#ifdef ABSL_HAVE_STD_OPTIONAL -#error "ABSL_HAVE_STD_OPTIONAL cannot be directly set." +#ifdef Y_ABSL_HAVE_STD_OPTIONAL +#error "Y_ABSL_HAVE_STD_OPTIONAL cannot be directly set." #endif #ifdef __has_include #if __has_include(<optional>) && defined(__cplusplus) && \ - __cplusplus >= 201703L && !ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE -#define ABSL_HAVE_STD_OPTIONAL 1 + __cplusplus >= 201703L && !Y_ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE +#define Y_ABSL_HAVE_STD_OPTIONAL 1 #endif #endif -// ABSL_HAVE_STD_VARIANT +// Y_ABSL_HAVE_STD_VARIANT // // Checks whether C++17 std::variant is available. -#ifdef ABSL_HAVE_STD_VARIANT -#error "ABSL_HAVE_STD_VARIANT cannot be directly set." +#ifdef Y_ABSL_HAVE_STD_VARIANT +#error "Y_ABSL_HAVE_STD_VARIANT cannot be directly set." #endif #ifdef __has_include #if __has_include(<variant>) && defined(__cplusplus) && \ - __cplusplus >= 201703L && !ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE -#define ABSL_HAVE_STD_VARIANT 1 + __cplusplus >= 201703L && !Y_ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE +#define Y_ABSL_HAVE_STD_VARIANT 1 #endif #endif -// ABSL_HAVE_STD_STRING_VIEW +// Y_ABSL_HAVE_STD_STRING_VIEW // // Checks whether C++17 std::string_view is available. -#ifdef ABSL_HAVE_STD_STRING_VIEW -#error "ABSL_HAVE_STD_STRING_VIEW cannot be directly set." +#ifdef Y_ABSL_HAVE_STD_STRING_VIEW +#error "Y_ABSL_HAVE_STD_STRING_VIEW cannot be directly set." #endif -#define ABSL_HAVE_STD_STRING_VIEW 1 +#define Y_ABSL_HAVE_STD_STRING_VIEW 1 // For MSVC, `__has_include` is supported in VS 2017 15.3, which is later than // the support for <optional>, <any>, <string_view>, <variant>. So we use @@ -602,70 +602,70 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || #if defined(_MSC_VER) && _MSC_VER >= 1910 && \ ((defined(_MSVC_LANG) && _MSVC_LANG > 201402) || \ (defined(__cplusplus) && __cplusplus > 201402)) -// #define ABSL_HAVE_STD_ANY 1 -#define ABSL_HAVE_STD_OPTIONAL 1 -#define ABSL_HAVE_STD_VARIANT 1 -#define ABSL_HAVE_STD_STRING_VIEW 1 +// #define Y_ABSL_HAVE_STD_ANY 1 +#define Y_ABSL_HAVE_STD_OPTIONAL 1 +#define Y_ABSL_HAVE_STD_VARIANT 1 +#define Y_ABSL_HAVE_STD_STRING_VIEW 1 #endif -// ABSL_USES_STD_ANY +// Y_ABSL_USES_STD_ANY // // Indicates whether y_absl::any is an alias for std::any. -#if !defined(ABSL_OPTION_USE_STD_ANY) +#if !defined(Y_ABSL_OPTION_USE_STD_ANY) #error options.h is misconfigured. -#elif ABSL_OPTION_USE_STD_ANY == 0 || \ - (ABSL_OPTION_USE_STD_ANY == 2 && !defined(ABSL_HAVE_STD_ANY)) -#undef ABSL_USES_STD_ANY -#elif ABSL_OPTION_USE_STD_ANY == 1 || \ - (ABSL_OPTION_USE_STD_ANY == 2 && defined(ABSL_HAVE_STD_ANY)) -#define ABSL_USES_STD_ANY 1 +#elif Y_ABSL_OPTION_USE_STD_ANY == 0 || \ + (Y_ABSL_OPTION_USE_STD_ANY == 2 && !defined(Y_ABSL_HAVE_STD_ANY)) +#undef Y_ABSL_USES_STD_ANY +#elif Y_ABSL_OPTION_USE_STD_ANY == 1 || \ + (Y_ABSL_OPTION_USE_STD_ANY == 2 && defined(Y_ABSL_HAVE_STD_ANY)) +#define Y_ABSL_USES_STD_ANY 1 #else #error options.h is misconfigured. #endif -// ABSL_USES_STD_OPTIONAL +// Y_ABSL_USES_STD_OPTIONAL // // Indicates whether y_absl::optional is an alias for std::optional. -#if !defined(ABSL_OPTION_USE_STD_OPTIONAL) +#if !defined(Y_ABSL_OPTION_USE_STD_OPTIONAL) #error options.h is misconfigured. -#elif ABSL_OPTION_USE_STD_OPTIONAL == 0 || \ - (ABSL_OPTION_USE_STD_OPTIONAL == 2 && !defined(ABSL_HAVE_STD_OPTIONAL)) -#undef ABSL_USES_STD_OPTIONAL -#elif ABSL_OPTION_USE_STD_OPTIONAL == 1 || \ - (ABSL_OPTION_USE_STD_OPTIONAL == 2 && defined(ABSL_HAVE_STD_OPTIONAL)) -#define ABSL_USES_STD_OPTIONAL 1 +#elif Y_ABSL_OPTION_USE_STD_OPTIONAL == 0 || \ + (Y_ABSL_OPTION_USE_STD_OPTIONAL == 2 && !defined(Y_ABSL_HAVE_STD_OPTIONAL)) +#undef Y_ABSL_USES_STD_OPTIONAL +#elif Y_ABSL_OPTION_USE_STD_OPTIONAL == 1 || \ + (Y_ABSL_OPTION_USE_STD_OPTIONAL == 2 && defined(Y_ABSL_HAVE_STD_OPTIONAL)) +#define Y_ABSL_USES_STD_OPTIONAL 1 #else #error options.h is misconfigured. #endif -// ABSL_USES_STD_VARIANT +// Y_ABSL_USES_STD_VARIANT // // Indicates whether y_absl::variant is an alias for std::variant. -#if !defined(ABSL_OPTION_USE_STD_VARIANT) +#if !defined(Y_ABSL_OPTION_USE_STD_VARIANT) #error options.h is misconfigured. -#elif ABSL_OPTION_USE_STD_VARIANT == 0 || \ - (ABSL_OPTION_USE_STD_VARIANT == 2 && !defined(ABSL_HAVE_STD_VARIANT)) -#undef ABSL_USES_STD_VARIANT -#elif ABSL_OPTION_USE_STD_VARIANT == 1 || \ - (ABSL_OPTION_USE_STD_VARIANT == 2 && defined(ABSL_HAVE_STD_VARIANT)) -#define ABSL_USES_STD_VARIANT 1 +#elif Y_ABSL_OPTION_USE_STD_VARIANT == 0 || \ + (Y_ABSL_OPTION_USE_STD_VARIANT == 2 && !defined(Y_ABSL_HAVE_STD_VARIANT)) +#undef Y_ABSL_USES_STD_VARIANT +#elif Y_ABSL_OPTION_USE_STD_VARIANT == 1 || \ + (Y_ABSL_OPTION_USE_STD_VARIANT == 2 && defined(Y_ABSL_HAVE_STD_VARIANT)) +#define Y_ABSL_USES_STD_VARIANT 1 #else #error options.h is misconfigured. #endif -// ABSL_USES_STD_STRING_VIEW +// Y_ABSL_USES_STD_STRING_VIEW // // Indicates whether y_absl::string_view is an alias for std::string_view. -#if !defined(ABSL_OPTION_USE_STD_STRING_VIEW) +#if !defined(Y_ABSL_OPTION_USE_STD_STRING_VIEW) #error options.h is misconfigured. -#elif ABSL_OPTION_USE_STD_STRING_VIEW == 0 || \ - (ABSL_OPTION_USE_STD_STRING_VIEW == 2 && \ - !defined(ABSL_HAVE_STD_STRING_VIEW)) -#undef ABSL_USES_STD_STRING_VIEW -#elif ABSL_OPTION_USE_STD_STRING_VIEW == 1 || \ - (ABSL_OPTION_USE_STD_STRING_VIEW == 2 && \ - defined(ABSL_HAVE_STD_STRING_VIEW)) -#define ABSL_USES_STD_STRING_VIEW 1 +#elif Y_ABSL_OPTION_USE_STD_STRING_VIEW == 0 || \ + (Y_ABSL_OPTION_USE_STD_STRING_VIEW == 2 && \ + !defined(Y_ABSL_HAVE_STD_STRING_VIEW)) +#undef Y_ABSL_USES_STD_STRING_VIEW +#elif Y_ABSL_OPTION_USE_STD_STRING_VIEW == 1 || \ + (Y_ABSL_OPTION_USE_STD_STRING_VIEW == 2 && \ + defined(Y_ABSL_HAVE_STD_STRING_VIEW)) +#define Y_ABSL_USES_STD_STRING_VIEW 1 #else #error options.h is misconfigured. #endif @@ -675,34 +675,34 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || // struct can throw. This defeats some of variant_test and // variant_exception_safety_test. #if defined(_MSC_VER) && _MSC_VER >= 1700 && defined(_DEBUG) -#define ABSL_INTERNAL_MSVC_2017_DBG_MODE +#define Y_ABSL_INTERNAL_MSVC_2017_DBG_MODE #endif -// ABSL_INTERNAL_MANGLED_NS -// ABSL_INTERNAL_MANGLED_BACKREFERENCE +// Y_ABSL_INTERNAL_MANGLED_NS +// Y_ABSL_INTERNAL_MANGLED_BACKREFERENCE // // Internal macros for building up mangled names in our internal fork of CCTZ. // This implementation detail is only needed and provided for the MSVC build. // -// These macros both expand to string literals. ABSL_INTERNAL_MANGLED_NS is +// These macros both expand to string literals. Y_ABSL_INTERNAL_MANGLED_NS is // the mangled spelling of the `y_absl` namespace, and -// ABSL_INTERNAL_MANGLED_BACKREFERENCE is a back-reference integer representing +// Y_ABSL_INTERNAL_MANGLED_BACKREFERENCE is a back-reference integer representing // the proper count to skip past the CCTZ fork namespace names. (This number // is one larger when there is an inline namespace name to skip.) #if defined(_MSC_VER) -#if ABSL_OPTION_USE_INLINE_NAMESPACE == 0 -#define ABSL_INTERNAL_MANGLED_NS "y_absl" -#define ABSL_INTERNAL_MANGLED_BACKREFERENCE "5" +#if Y_ABSL_OPTION_USE_INLINE_NAMESPACE == 0 +#define Y_ABSL_INTERNAL_MANGLED_NS "y_absl" +#define Y_ABSL_INTERNAL_MANGLED_BACKREFERENCE "5" #else -#define ABSL_INTERNAL_MANGLED_NS \ - ABSL_INTERNAL_TOKEN_STR(ABSL_OPTION_INLINE_NAMESPACE_NAME) "@y_absl" -#define ABSL_INTERNAL_MANGLED_BACKREFERENCE "6" +#define Y_ABSL_INTERNAL_MANGLED_NS \ + Y_ABSL_INTERNAL_TOKEN_STR(Y_ABSL_OPTION_INLINE_NAMESPACE_NAME) "@y_absl" +#define Y_ABSL_INTERNAL_MANGLED_BACKREFERENCE "6" #endif #endif -#undef ABSL_INTERNAL_HAS_KEYWORD +#undef Y_ABSL_INTERNAL_HAS_KEYWORD -// ABSL_DLL +// Y_ABSL_DLL // // When building Abseil as a DLL, this macro expands to `__declspec(dllexport)` // so we can annotate symbols appropriately as being exported. When used in @@ -710,58 +710,58 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' || // that consumers know the symbol is defined inside the DLL. In all other cases, // the macro expands to nothing. #if defined(_MSC_VER) -#if defined(ABSL_BUILD_DLL) -#define ABSL_DLL __declspec(dllexport) -#elif defined(ABSL_CONSUME_DLL) -#define ABSL_DLL __declspec(dllimport) +#if defined(Y_ABSL_BUILD_DLL) +#define Y_ABSL_DLL __declspec(dllexport) +#elif defined(Y_ABSL_CONSUME_DLL) +#define Y_ABSL_DLL __declspec(dllimport) #else -#define ABSL_DLL +#define Y_ABSL_DLL #endif #else -#define ABSL_DLL +#define Y_ABSL_DLL #endif // defined(_MSC_VER) -// ABSL_HAVE_MEMORY_SANITIZER +// Y_ABSL_HAVE_MEMORY_SANITIZER // // MemorySanitizer (MSan) is a detector of uninitialized reads. It consists of // a compiler instrumentation module and a run-time library. -#ifdef ABSL_HAVE_MEMORY_SANITIZER -#error "ABSL_HAVE_MEMORY_SANITIZER cannot be directly set." +#ifdef Y_ABSL_HAVE_MEMORY_SANITIZER +#error "Y_ABSL_HAVE_MEMORY_SANITIZER cannot be directly set." #elif defined(__SANITIZE_MEMORY__) -#define ABSL_HAVE_MEMORY_SANITIZER 1 -#elif !defined(__native_client__) && ABSL_HAVE_FEATURE(memory_sanitizer) -#define ABSL_HAVE_MEMORY_SANITIZER 1 +#define Y_ABSL_HAVE_MEMORY_SANITIZER 1 +#elif !defined(__native_client__) && Y_ABSL_HAVE_FEATURE(memory_sanitizer) +#define Y_ABSL_HAVE_MEMORY_SANITIZER 1 #endif -// ABSL_HAVE_THREAD_SANITIZER +// Y_ABSL_HAVE_THREAD_SANITIZER // // ThreadSanitizer (TSan) is a fast data race detector. -#ifdef ABSL_HAVE_THREAD_SANITIZER -#error "ABSL_HAVE_THREAD_SANITIZER cannot be directly set." +#ifdef Y_ABSL_HAVE_THREAD_SANITIZER +#error "Y_ABSL_HAVE_THREAD_SANITIZER cannot be directly set." #elif defined(__SANITIZE_THREAD__) -#define ABSL_HAVE_THREAD_SANITIZER 1 -#elif ABSL_HAVE_FEATURE(thread_sanitizer) -#define ABSL_HAVE_THREAD_SANITIZER 1 +#define Y_ABSL_HAVE_THREAD_SANITIZER 1 +#elif Y_ABSL_HAVE_FEATURE(thread_sanitizer) +#define Y_ABSL_HAVE_THREAD_SANITIZER 1 #endif -// ABSL_HAVE_ADDRESS_SANITIZER +// Y_ABSL_HAVE_ADDRESS_SANITIZER // // AddressSanitizer (ASan) is a fast memory error detector. -#ifdef ABSL_HAVE_ADDRESS_SANITIZER -#error "ABSL_HAVE_ADDRESS_SANITIZER cannot be directly set." +#ifdef Y_ABSL_HAVE_ADDRESS_SANITIZER +#error "Y_ABSL_HAVE_ADDRESS_SANITIZER cannot be directly set." #elif defined(__SANITIZE_ADDRESS__) -#define ABSL_HAVE_ADDRESS_SANITIZER 1 -#elif ABSL_HAVE_FEATURE(address_sanitizer) -#define ABSL_HAVE_ADDRESS_SANITIZER 1 +#define Y_ABSL_HAVE_ADDRESS_SANITIZER 1 +#elif Y_ABSL_HAVE_FEATURE(address_sanitizer) +#define Y_ABSL_HAVE_ADDRESS_SANITIZER 1 #endif -// ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION +// Y_ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION // // Class template argument deduction is a language feature added in C++17. -#ifdef ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION -#error "ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION cannot be directly set." +#ifdef Y_ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION +#error "Y_ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION cannot be directly set." #elif defined(__cpp_deduction_guides) -#define ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION 1 +#define Y_ABSL_HAVE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION 1 #endif -#endif // ABSL_BASE_CONFIG_H_ +#endif // Y_ABSL_BASE_CONFIG_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/const_init.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/const_init.h index 4bab055dda..e08c42155f 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/const_init.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/const_init.h @@ -19,8 +19,8 @@ // A constructor tag used to mark an object as safe for use as a global // variable, avoiding the usual lifetime issues that can affect globals. -#ifndef ABSL_BASE_CONST_INIT_H_ -#define ABSL_BASE_CONST_INIT_H_ +#ifndef Y_ABSL_BASE_CONST_INIT_H_ +#define Y_ABSL_BASE_CONST_INIT_H_ #include "y_absl/base/config.h" @@ -36,7 +36,7 @@ // Constant initialization is guaranteed to occur before any other code // executes. Constructors that are declared 'constexpr' are eligible for // constant initialization. You can annotate a variable declaration with the -// ABSL_CONST_INIT macro to express this intent. For compilers that support +// Y_ABSL_CONST_INIT macro to express this intent. For compilers that support // it, this annotation will cause a compilation error for declarations that // aren't subject to constant initialization (perhaps because a runtime value // was passed as a constructor argument). @@ -52,7 +52,7 @@ // For a few core Abseil classes, we make a best effort to allow for safe global // instances, even though these classes have non-trivial destructors. These // objects can be created with the y_absl::kConstInit tag. For example: -// ABSL_CONST_INIT y_absl::Mutex global_mutex(y_absl::kConstInit); +// Y_ABSL_CONST_INIT y_absl::Mutex global_mutex(y_absl::kConstInit); // // The line above declares a global variable of type y_absl::Mutex which can be // accessed at any point during startup or shutdown. global_mutex's destructor @@ -64,13 +64,13 @@ // or thread_local storage duration. namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN enum ConstInitType { kConstInit, }; -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_CONST_INIT_H_ +#endif // Y_ABSL_BASE_CONST_INIT_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/dynamic_annotations.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/dynamic_annotations.h index 50b3122cf7..1baab26165 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/dynamic_annotations.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/dynamic_annotations.h @@ -21,7 +21,7 @@ // in the program. // // The annotations that should be used by users are macros in all upper-case -// (e.g., ABSL_ANNOTATE_THREAD_NAME). +// (e.g., Y_ABSL_ANNOTATE_THREAD_NAME). // // Actual implementation of these macros may differ depending on the dynamic // analysis tool being used. @@ -42,8 +42,8 @@ // If neither Dynamic Annotations nor Clang thread-safety warnings are // enabled, then all annotation-macros expand to empty. -#ifndef ABSL_BASE_DYNAMIC_ANNOTATIONS_H_ -#define ABSL_BASE_DYNAMIC_ANNOTATIONS_H_ +#ifndef Y_ABSL_BASE_DYNAMIC_ANNOTATIONS_H_ +#define Y_ABSL_BASE_DYNAMIC_ANNOTATIONS_H_ #include <stddef.h> @@ -59,19 +59,19 @@ // ------------------------------------------------------------------------- // Decide which features are enabled. -#ifdef ABSL_HAVE_THREAD_SANITIZER +#ifdef Y_ABSL_HAVE_THREAD_SANITIZER -#define ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 1 -#define ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 1 -#define ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 1 -#define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 0 -#define ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED 1 +#define Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 1 +#define Y_ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 1 +#define Y_ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 1 +#define Y_ABSL_INTERNAL_ANNOTALYSIS_ENABLED 0 +#define Y_ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED 1 #else -#define ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 0 -#define ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 0 -#define ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 0 +#define Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 0 +#define Y_ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 0 +#define Y_ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 0 // Clang provides limited support for static thread-safety analysis through a // feature called Annotalysis. We configure macro-definitions according to @@ -80,39 +80,39 @@ // when compiling using Clang. #if defined(__clang__) -#define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 1 +#define Y_ABSL_INTERNAL_ANNOTALYSIS_ENABLED 1 #if !defined(SWIG) -#define ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED 1 +#define Y_ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED 1 #endif #else -#define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 0 +#define Y_ABSL_INTERNAL_ANNOTALYSIS_ENABLED 0 #endif // Read/write annotations are enabled in Annotalysis mode; disabled otherwise. -#define ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED \ - ABSL_INTERNAL_ANNOTALYSIS_ENABLED +#define Y_ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED \ + Y_ABSL_INTERNAL_ANNOTALYSIS_ENABLED -#endif // ABSL_HAVE_THREAD_SANITIZER +#endif // Y_ABSL_HAVE_THREAD_SANITIZER #ifdef __cplusplus -#define ABSL_INTERNAL_BEGIN_EXTERN_C extern "C" { -#define ABSL_INTERNAL_END_EXTERN_C } // extern "C" -#define ABSL_INTERNAL_GLOBAL_SCOPED(F) ::F -#define ABSL_INTERNAL_STATIC_INLINE inline +#define Y_ABSL_INTERNAL_BEGIN_EXTERN_C extern "C" { +#define Y_ABSL_INTERNAL_END_EXTERN_C } // extern "C" +#define Y_ABSL_INTERNAL_GLOBAL_SCOPED(F) ::F +#define Y_ABSL_INTERNAL_STATIC_INLINE inline #else -#define ABSL_INTERNAL_BEGIN_EXTERN_C // empty -#define ABSL_INTERNAL_END_EXTERN_C // empty -#define ABSL_INTERNAL_GLOBAL_SCOPED(F) F -#define ABSL_INTERNAL_STATIC_INLINE static inline +#define Y_ABSL_INTERNAL_BEGIN_EXTERN_C // empty +#define Y_ABSL_INTERNAL_END_EXTERN_C // empty +#define Y_ABSL_INTERNAL_GLOBAL_SCOPED(F) F +#define Y_ABSL_INTERNAL_STATIC_INLINE static inline #endif // ------------------------------------------------------------------------- // Define race annotations. -#if ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 1 +#if Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 1 // Some of the symbols used in this section (e.g. AnnotateBenignRaceSized) are // defined by the compiler-based santizer implementation, not by the Abseil -// library. Therefore they do not use ABSL_INTERNAL_C_SYMBOL. +// library. Therefore they do not use Y_ABSL_INTERNAL_C_SYMBOL. // ------------------------------------------------------------- // Annotations that suppress errors. It is usually better to express the @@ -122,30 +122,30 @@ // Report that we may have a benign race at `pointer`, with size // "sizeof(*(pointer))". `pointer` must be a non-void* pointer. Insert at the // point where `pointer` has been allocated, preferably close to the point -// where the race happens. See also ABSL_ANNOTATE_BENIGN_RACE_STATIC. -#define ABSL_ANNOTATE_BENIGN_RACE(pointer, description) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \ +// where the race happens. See also Y_ABSL_ANNOTATE_BENIGN_RACE_STATIC. +#define Y_ABSL_ANNOTATE_BENIGN_RACE(pointer, description) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \ (__FILE__, __LINE__, pointer, sizeof(*(pointer)), description) -// Same as ABSL_ANNOTATE_BENIGN_RACE(`address`, `description`), but applies to +// Same as Y_ABSL_ANNOTATE_BENIGN_RACE(`address`, `description`), but applies to // the memory range [`address`, `address`+`size`). -#define ABSL_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \ +#define Y_ABSL_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \ (__FILE__, __LINE__, address, size, description) // Enable (`enable`!=0) or disable (`enable`==0) race detection for all threads. // This annotation could be useful if you want to skip expensive race analysis // during some period of program execution, e.g. during initialization. -#define ABSL_ANNOTATE_ENABLE_RACE_DETECTION(enable) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateEnableRaceDetection) \ +#define Y_ABSL_ANNOTATE_ENABLE_RACE_DETECTION(enable) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateEnableRaceDetection) \ (__FILE__, __LINE__, enable) // ------------------------------------------------------------- // Annotations useful for debugging. // Report the current thread `name` to a race detector. -#define ABSL_ANNOTATE_THREAD_NAME(name) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateThreadName)(__FILE__, __LINE__, name) +#define Y_ABSL_ANNOTATE_THREAD_NAME(name) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateThreadName)(__FILE__, __LINE__, name) // ------------------------------------------------------------- // Annotations useful when implementing locks. They are not normally needed by @@ -153,42 +153,42 @@ // object. // Report that a lock has been created at address `lock`. -#define ABSL_ANNOTATE_RWLOCK_CREATE(lock) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreate)(__FILE__, __LINE__, lock) +#define Y_ABSL_ANNOTATE_RWLOCK_CREATE(lock) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreate)(__FILE__, __LINE__, lock) // Report that a linker initialized lock has been created at address `lock`. -#ifdef ABSL_HAVE_THREAD_SANITIZER -#define ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreateStatic) \ +#ifdef Y_ABSL_HAVE_THREAD_SANITIZER +#define Y_ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreateStatic) \ (__FILE__, __LINE__, lock) #else -#define ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) \ - ABSL_ANNOTATE_RWLOCK_CREATE(lock) +#define Y_ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) \ + Y_ABSL_ANNOTATE_RWLOCK_CREATE(lock) #endif // Report that the lock at address `lock` is about to be destroyed. -#define ABSL_ANNOTATE_RWLOCK_DESTROY(lock) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockDestroy)(__FILE__, __LINE__, lock) +#define Y_ABSL_ANNOTATE_RWLOCK_DESTROY(lock) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockDestroy)(__FILE__, __LINE__, lock) // Report that the lock at address `lock` has been acquired. // `is_w`=1 for writer lock, `is_w`=0 for reader lock. -#define ABSL_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockAcquired) \ +#define Y_ABSL_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockAcquired) \ (__FILE__, __LINE__, lock, is_w) // Report that the lock at address `lock` is about to be released. // `is_w`=1 for writer lock, `is_w`=0 for reader lock. -#define ABSL_ANNOTATE_RWLOCK_RELEASED(lock, is_w) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockReleased) \ +#define Y_ABSL_ANNOTATE_RWLOCK_RELEASED(lock, is_w) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockReleased) \ (__FILE__, __LINE__, lock, is_w) -// Apply ABSL_ANNOTATE_BENIGN_RACE_SIZED to a static variable `static_var`. -#define ABSL_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) \ +// Apply Y_ABSL_ANNOTATE_BENIGN_RACE_SIZED to a static variable `static_var`. +#define Y_ABSL_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) \ namespace { \ class static_var##_annotator { \ public: \ static_var##_annotator() { \ - ABSL_ANNOTATE_BENIGN_RACE_SIZED(&static_var, sizeof(static_var), \ + Y_ABSL_ANNOTATE_BENIGN_RACE_SIZED(&static_var, sizeof(static_var), \ #static_var ": " description); \ } \ }; \ @@ -197,7 +197,7 @@ // Function prototypes of annotations provided by the compiler-based sanitizer // implementation. -ABSL_INTERNAL_BEGIN_EXTERN_C +Y_ABSL_INTERNAL_BEGIN_EXTERN_C void AnnotateRWLockCreate(const char* file, int line, const volatile void* lock); void AnnotateRWLockCreateStatic(const char* file, int line, @@ -215,107 +215,107 @@ void AnnotateBenignRaceSized(const char* file, int line, const char* description); void AnnotateThreadName(const char* file, int line, const char* name); void AnnotateEnableRaceDetection(const char* file, int line, int enable); -ABSL_INTERNAL_END_EXTERN_C +Y_ABSL_INTERNAL_END_EXTERN_C -#else // ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 0 +#else // Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 0 -#define ABSL_ANNOTATE_RWLOCK_CREATE(lock) // empty -#define ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) // empty -#define ABSL_ANNOTATE_RWLOCK_DESTROY(lock) // empty -#define ABSL_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) // empty -#define ABSL_ANNOTATE_RWLOCK_RELEASED(lock, is_w) // empty -#define ABSL_ANNOTATE_BENIGN_RACE(address, description) // empty -#define ABSL_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) // empty -#define ABSL_ANNOTATE_THREAD_NAME(name) // empty -#define ABSL_ANNOTATE_ENABLE_RACE_DETECTION(enable) // empty -#define ABSL_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) // empty +#define Y_ABSL_ANNOTATE_RWLOCK_CREATE(lock) // empty +#define Y_ABSL_ANNOTATE_RWLOCK_CREATE_STATIC(lock) // empty +#define Y_ABSL_ANNOTATE_RWLOCK_DESTROY(lock) // empty +#define Y_ABSL_ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) // empty +#define Y_ABSL_ANNOTATE_RWLOCK_RELEASED(lock, is_w) // empty +#define Y_ABSL_ANNOTATE_BENIGN_RACE(address, description) // empty +#define Y_ABSL_ANNOTATE_BENIGN_RACE_SIZED(address, size, description) // empty +#define Y_ABSL_ANNOTATE_THREAD_NAME(name) // empty +#define Y_ABSL_ANNOTATE_ENABLE_RACE_DETECTION(enable) // empty +#define Y_ABSL_ANNOTATE_BENIGN_RACE_STATIC(static_var, description) // empty -#endif // ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED +#endif // Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED // ------------------------------------------------------------------------- // Define memory annotations. -#ifdef ABSL_HAVE_MEMORY_SANITIZER +#ifdef Y_ABSL_HAVE_MEMORY_SANITIZER #include <sanitizer/msan_interface.h> -#define ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \ +#define Y_ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \ __msan_unpoison(address, size) -#define ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) \ +#define Y_ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) \ __msan_allocated_memory(address, size) -#else // !defined(ABSL_HAVE_MEMORY_SANITIZER) +#else // !defined(Y_ABSL_HAVE_MEMORY_SANITIZER) // TODO(rogeeff): remove this branch -#ifdef ABSL_HAVE_THREAD_SANITIZER -#define ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \ +#ifdef Y_ABSL_HAVE_THREAD_SANITIZER +#define Y_ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \ do { \ (void)(address); \ (void)(size); \ } while (0) -#define ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) \ +#define Y_ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) \ do { \ (void)(address); \ (void)(size); \ } while (0) #else -#define ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) // empty -#define ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) // empty +#define Y_ABSL_ANNOTATE_MEMORY_IS_INITIALIZED(address, size) // empty +#define Y_ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) // empty #endif -#endif // ABSL_HAVE_MEMORY_SANITIZER +#endif // Y_ABSL_HAVE_MEMORY_SANITIZER // ------------------------------------------------------------------------- // Define IGNORE_READS_BEGIN/_END attributes. -#if defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) +#if defined(Y_ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) -#define ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE \ +#define Y_ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE \ __attribute((exclusive_lock_function("*"))) -#define ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE \ +#define Y_ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE \ __attribute((unlock_function("*"))) -#else // !defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) +#else // !defined(Y_ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) -#define ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE // empty -#define ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE // empty +#define Y_ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE // empty +#define Y_ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE // empty -#endif // defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) +#endif // defined(Y_ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) // ------------------------------------------------------------------------- // Define IGNORE_READS_BEGIN/_END annotations. -#if ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED == 1 +#if Y_ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED == 1 // Some of the symbols used in this section (e.g. AnnotateIgnoreReadsBegin) are // defined by the compiler-based implementation, not by the Abseil -// library. Therefore they do not use ABSL_INTERNAL_C_SYMBOL. +// library. Therefore they do not use Y_ABSL_INTERNAL_C_SYMBOL. // Request the analysis tool to ignore all reads in the current thread until -// ABSL_ANNOTATE_IGNORE_READS_END is called. Useful to ignore intentional racey +// Y_ABSL_ANNOTATE_IGNORE_READS_END is called. Useful to ignore intentional racey // reads, while still checking other reads and all writes. -// See also ABSL_ANNOTATE_UNPROTECTED_READ. -#define ABSL_ANNOTATE_IGNORE_READS_BEGIN() \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsBegin) \ +// See also Y_ABSL_ANNOTATE_UNPROTECTED_READ. +#define Y_ABSL_ANNOTATE_IGNORE_READS_BEGIN() \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsBegin) \ (__FILE__, __LINE__) // Stop ignoring reads. -#define ABSL_ANNOTATE_IGNORE_READS_END() \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsEnd) \ +#define Y_ABSL_ANNOTATE_IGNORE_READS_END() \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsEnd) \ (__FILE__, __LINE__) // Function prototypes of annotations provided by the compiler-based sanitizer // implementation. -ABSL_INTERNAL_BEGIN_EXTERN_C +Y_ABSL_INTERNAL_BEGIN_EXTERN_C void AnnotateIgnoreReadsBegin(const char* file, int line) - ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE; + Y_ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE; void AnnotateIgnoreReadsEnd(const char* file, - int line) ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE; -ABSL_INTERNAL_END_EXTERN_C + int line) Y_ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE; +Y_ABSL_INTERNAL_END_EXTERN_C -#elif defined(ABSL_INTERNAL_ANNOTALYSIS_ENABLED) +#elif defined(Y_ABSL_INTERNAL_ANNOTALYSIS_ENABLED) // When Annotalysis is enabled without Dynamic Annotations, the use of // static-inline functions allows the annotations to be read at compile-time, @@ -324,148 +324,148 @@ ABSL_INTERNAL_END_EXTERN_C // TODO(delesley) -- The exclusive lock here ignores writes as well, but // allows IGNORE_READS_AND_WRITES to work properly. -#define ABSL_ANNOTATE_IGNORE_READS_BEGIN() \ - ABSL_INTERNAL_GLOBAL_SCOPED( \ - ABSL_INTERNAL_C_SYMBOL(AbslInternalAnnotateIgnoreReadsBegin)) \ +#define Y_ABSL_ANNOTATE_IGNORE_READS_BEGIN() \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED( \ + Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalAnnotateIgnoreReadsBegin)) \ () -#define ABSL_ANNOTATE_IGNORE_READS_END() \ - ABSL_INTERNAL_GLOBAL_SCOPED( \ - ABSL_INTERNAL_C_SYMBOL(AbslInternalAnnotateIgnoreReadsEnd)) \ +#define Y_ABSL_ANNOTATE_IGNORE_READS_END() \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED( \ + Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalAnnotateIgnoreReadsEnd)) \ () -ABSL_INTERNAL_STATIC_INLINE void ABSL_INTERNAL_C_SYMBOL( +Y_ABSL_INTERNAL_STATIC_INLINE void Y_ABSL_INTERNAL_C_SYMBOL( AbslInternalAnnotateIgnoreReadsBegin)() - ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE {} + Y_ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE {} -ABSL_INTERNAL_STATIC_INLINE void ABSL_INTERNAL_C_SYMBOL( +Y_ABSL_INTERNAL_STATIC_INLINE void Y_ABSL_INTERNAL_C_SYMBOL( AbslInternalAnnotateIgnoreReadsEnd)() - ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE {} + Y_ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE {} #else -#define ABSL_ANNOTATE_IGNORE_READS_BEGIN() // empty -#define ABSL_ANNOTATE_IGNORE_READS_END() // empty +#define Y_ABSL_ANNOTATE_IGNORE_READS_BEGIN() // empty +#define Y_ABSL_ANNOTATE_IGNORE_READS_END() // empty #endif // ------------------------------------------------------------------------- // Define IGNORE_WRITES_BEGIN/_END annotations. -#if ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED == 1 +#if Y_ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED == 1 -// Similar to ABSL_ANNOTATE_IGNORE_READS_BEGIN, but ignore writes instead. -#define ABSL_ANNOTATE_IGNORE_WRITES_BEGIN() \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesBegin)(__FILE__, __LINE__) +// Similar to Y_ABSL_ANNOTATE_IGNORE_READS_BEGIN, but ignore writes instead. +#define Y_ABSL_ANNOTATE_IGNORE_WRITES_BEGIN() \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesBegin)(__FILE__, __LINE__) // Stop ignoring writes. -#define ABSL_ANNOTATE_IGNORE_WRITES_END() \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesEnd)(__FILE__, __LINE__) +#define Y_ABSL_ANNOTATE_IGNORE_WRITES_END() \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesEnd)(__FILE__, __LINE__) // Function prototypes of annotations provided by the compiler-based sanitizer // implementation. -ABSL_INTERNAL_BEGIN_EXTERN_C +Y_ABSL_INTERNAL_BEGIN_EXTERN_C void AnnotateIgnoreWritesBegin(const char* file, int line); void AnnotateIgnoreWritesEnd(const char* file, int line); -ABSL_INTERNAL_END_EXTERN_C +Y_ABSL_INTERNAL_END_EXTERN_C #else -#define ABSL_ANNOTATE_IGNORE_WRITES_BEGIN() // empty -#define ABSL_ANNOTATE_IGNORE_WRITES_END() // empty +#define Y_ABSL_ANNOTATE_IGNORE_WRITES_BEGIN() // empty +#define Y_ABSL_ANNOTATE_IGNORE_WRITES_END() // empty #endif // ------------------------------------------------------------------------- -// Define the ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_* annotations using the more +// Define the Y_ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_* annotations using the more // primitive annotations defined above. // // Instead of doing -// ABSL_ANNOTATE_IGNORE_READS_BEGIN(); +// Y_ABSL_ANNOTATE_IGNORE_READS_BEGIN(); // ... = x; -// ABSL_ANNOTATE_IGNORE_READS_END(); +// Y_ABSL_ANNOTATE_IGNORE_READS_END(); // one can use -// ... = ABSL_ANNOTATE_UNPROTECTED_READ(x); +// ... = Y_ABSL_ANNOTATE_UNPROTECTED_READ(x); -#if defined(ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED) +#if defined(Y_ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED) // Start ignoring all memory accesses (both reads and writes). -#define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \ +#define Y_ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \ do { \ - ABSL_ANNOTATE_IGNORE_READS_BEGIN(); \ - ABSL_ANNOTATE_IGNORE_WRITES_BEGIN(); \ + Y_ABSL_ANNOTATE_IGNORE_READS_BEGIN(); \ + Y_ABSL_ANNOTATE_IGNORE_WRITES_BEGIN(); \ } while (0) // Stop ignoring both reads and writes. -#define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_END() \ +#define Y_ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_END() \ do { \ - ABSL_ANNOTATE_IGNORE_WRITES_END(); \ - ABSL_ANNOTATE_IGNORE_READS_END(); \ + Y_ABSL_ANNOTATE_IGNORE_WRITES_END(); \ + Y_ABSL_ANNOTATE_IGNORE_READS_END(); \ } while (0) #ifdef __cplusplus -// ABSL_ANNOTATE_UNPROTECTED_READ is the preferred way to annotate racey reads. -#define ABSL_ANNOTATE_UNPROTECTED_READ(x) \ +// Y_ABSL_ANNOTATE_UNPROTECTED_READ is the preferred way to annotate racey reads. +#define Y_ABSL_ANNOTATE_UNPROTECTED_READ(x) \ y_absl::base_internal::AnnotateUnprotectedRead(x) namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { template <typename T> inline T AnnotateUnprotectedRead(const volatile T& x) { // NOLINT - ABSL_ANNOTATE_IGNORE_READS_BEGIN(); + Y_ABSL_ANNOTATE_IGNORE_READS_BEGIN(); T res = x; - ABSL_ANNOTATE_IGNORE_READS_END(); + Y_ABSL_ANNOTATE_IGNORE_READS_END(); return res; } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl #endif #else -#define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() // empty -#define ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_END() // empty -#define ABSL_ANNOTATE_UNPROTECTED_READ(x) (x) +#define Y_ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() // empty +#define Y_ABSL_ANNOTATE_IGNORE_READS_AND_WRITES_END() // empty +#define Y_ABSL_ANNOTATE_UNPROTECTED_READ(x) (x) #endif // ------------------------------------------------------------------------- // Address sanitizer annotations -#ifdef ABSL_HAVE_ADDRESS_SANITIZER +#ifdef Y_ABSL_HAVE_ADDRESS_SANITIZER // Describe the current state of a contiguous container such as e.g. // std::vector or TString. For more details see // sanitizer/common_interface_defs.h, which is provided by the compiler. #include <sanitizer/common_interface_defs.h> -#define ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) \ +#define Y_ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) \ __sanitizer_annotate_contiguous_container(beg, end, old_mid, new_mid) -#define ABSL_ADDRESS_SANITIZER_REDZONE(name) \ +#define Y_ABSL_ADDRESS_SANITIZER_REDZONE(name) \ struct { \ alignas(8) char x[8]; \ } name #else -#define ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) // empty -#define ABSL_ADDRESS_SANITIZER_REDZONE(name) static_assert(true, "") +#define Y_ABSL_ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) // empty +#define Y_ABSL_ADDRESS_SANITIZER_REDZONE(name) static_assert(true, "") -#endif // ABSL_HAVE_ADDRESS_SANITIZER +#endif // Y_ABSL_HAVE_ADDRESS_SANITIZER // ------------------------------------------------------------------------- // Undefine the macros intended only for this file. -#undef ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED -#undef ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED -#undef ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED -#undef ABSL_INTERNAL_ANNOTALYSIS_ENABLED -#undef ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED -#undef ABSL_INTERNAL_BEGIN_EXTERN_C -#undef ABSL_INTERNAL_END_EXTERN_C -#undef ABSL_INTERNAL_STATIC_INLINE +#undef Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED +#undef Y_ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED +#undef Y_ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED +#undef Y_ABSL_INTERNAL_ANNOTALYSIS_ENABLED +#undef Y_ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED +#undef Y_ABSL_INTERNAL_BEGIN_EXTERN_C +#undef Y_ABSL_INTERNAL_END_EXTERN_C +#undef Y_ABSL_INTERNAL_STATIC_INLINE -#endif // ABSL_BASE_DYNAMIC_ANNOTATIONS_H_ +#endif // Y_ABSL_BASE_DYNAMIC_ANNOTATIONS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/atomic_hook.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/atomic_hook.h index 5bdf360a57..462879f494 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/atomic_hook.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/atomic_hook.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_BASE_INTERNAL_ATOMIC_HOOK_H_ -#define ABSL_BASE_INTERNAL_ATOMIC_HOOK_H_ +#ifndef Y_ABSL_BASE_INTERNAL_ATOMIC_HOOK_H_ +#define Y_ABSL_BASE_INTERNAL_ATOMIC_HOOK_H_ #include <atomic> #include <cassert> @@ -24,31 +24,31 @@ #include "y_absl/base/config.h" #if defined(_MSC_VER) && !defined(__clang__) -#define ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT 0 +#define Y_ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT 0 #else -#define ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT 1 +#define Y_ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT 1 #endif #if defined(_MSC_VER) -#define ABSL_HAVE_WORKING_ATOMIC_POINTER 0 +#define Y_ABSL_HAVE_WORKING_ATOMIC_POINTER 0 #else -#define ABSL_HAVE_WORKING_ATOMIC_POINTER 1 +#define Y_ABSL_HAVE_WORKING_ATOMIC_POINTER 1 #endif namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { template <typename T> class AtomicHook; // To workaround AtomicHook not being constant-initializable on some platforms, -// prefer to annotate instances with `ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES` -// instead of `ABSL_CONST_INIT`. -#if ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT -#define ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES ABSL_CONST_INIT +// prefer to annotate instances with `Y_ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES` +// instead of `Y_ABSL_CONST_INIT`. +#if Y_ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT +#define Y_ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES Y_ABSL_CONST_INIT #else -#define ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES +#define Y_ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES #endif // `AtomicHook` is a helper class, templatized on a raw function pointer type, @@ -61,7 +61,7 @@ class AtomicHook; // // Hooks can be pre-registered via constant initialization, for example: // -// ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES static AtomicHook<void(*)()> +// Y_ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES static AtomicHook<void(*)()> // my_hook(DefaultAction); // // and then changed at runtime via a call to `Store()`. @@ -79,10 +79,10 @@ class AtomicHook<ReturnType (*)(Args...)> { // Constructs an object that by default dispatches to/returns the // pre-registered default_fn when no hook has been registered at runtime. -#if ABSL_HAVE_WORKING_ATOMIC_POINTER && ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT +#if Y_ABSL_HAVE_WORKING_ATOMIC_POINTER && Y_ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT explicit constexpr AtomicHook(FnPtr default_fn) : hook_(default_fn), default_fn_(default_fn) {} -#elif ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT +#elif Y_ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT explicit constexpr AtomicHook(FnPtr default_fn) : hook_(kUninitialized), default_fn_(default_fn) {} #else @@ -143,7 +143,7 @@ class AtomicHook<ReturnType (*)(Args...)> { // // This causes an issue when building with LLVM under Windows. To avoid this, // we use a less-efficient, intptr_t-based implementation on Windows. -#if ABSL_HAVE_WORKING_ATOMIC_POINTER +#if Y_ABSL_HAVE_WORKING_ATOMIC_POINTER // Return the stored value, or DummyFunction if no value has been stored. FnPtr DoLoad() const { return hook_.load(std::memory_order_acquire); } @@ -159,7 +159,7 @@ class AtomicHook<ReturnType (*)(Args...)> { } std::atomic<FnPtr> hook_; -#else // !ABSL_HAVE_WORKING_ATOMIC_POINTER +#else // !Y_ABSL_HAVE_WORKING_ATOMIC_POINTER // Use a sentinel value unlikely to be the address of an actual function. static constexpr intptr_t kUninitialized = 0; @@ -190,11 +190,11 @@ class AtomicHook<ReturnType (*)(Args...)> { const FnPtr default_fn_; }; -#undef ABSL_HAVE_WORKING_ATOMIC_POINTER -#undef ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT +#undef Y_ABSL_HAVE_WORKING_ATOMIC_POINTER +#undef Y_ABSL_HAVE_WORKING_CONSTEXPR_STATIC_INIT } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_ATOMIC_HOOK_H_ +#endif // Y_ABSL_BASE_INTERNAL_ATOMIC_HOOK_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/atomic_hook_test_helper.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/atomic_hook_test_helper.h index e600d27f4f..6600c8fb69 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/atomic_hook_test_helper.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/atomic_hook_test_helper.h @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_BASE_ATOMIC_HOOK_TEST_HELPER_H_ -#define ABSL_BASE_ATOMIC_HOOK_TEST_HELPER_H_ +#ifndef Y_ABSL_BASE_ATOMIC_HOOK_TEST_HELPER_H_ +#define Y_ABSL_BASE_ATOMIC_HOOK_TEST_HELPER_H_ #include "y_absl/base/internal/atomic_hook.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace atomic_hook_internal { using VoidF = void (*)(); @@ -28,7 +28,7 @@ void DefaultFunc(); void RegisterFunc(VoidF func); } // namespace atomic_hook_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_ATOMIC_HOOK_TEST_HELPER_H_ +#endif // Y_ABSL_BASE_ATOMIC_HOOK_TEST_HELPER_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/cycleclock.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/cycleclock.cc index 6b43f7c184..f12104f9e4 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/cycleclock.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/cycleclock.cc @@ -28,15 +28,15 @@ #include "y_absl/base/internal/unscaledcycleclock.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { -#if ABSL_USE_UNSCALED_CYCLECLOCK +#if Y_ABSL_USE_UNSCALED_CYCLECLOCK namespace { #ifdef NDEBUG -#ifdef ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY +#ifdef Y_ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY // Not debug mode and the UnscaledCycleClock frequency is the CPU // frequency. Scale the CycleClock to prevent overflow if someone // tries to represent the time as cycles since the Unix epoch. @@ -103,5 +103,5 @@ double CycleClock::Frequency() { #endif } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/cycleclock.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/cycleclock.h index 389c9093e3..9777d214da 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/cycleclock.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/cycleclock.h @@ -39,15 +39,15 @@ // The CPU is not required to maintain the ordering of a cycle counter read // with respect to surrounding instructions. -#ifndef ABSL_BASE_INTERNAL_CYCLECLOCK_H_ -#define ABSL_BASE_INTERNAL_CYCLECLOCK_H_ +#ifndef Y_ABSL_BASE_INTERNAL_CYCLECLOCK_H_ +#define Y_ABSL_BASE_INTERNAL_CYCLECLOCK_H_ #include <cstdint> #include "y_absl/base/config.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // ----------------------------------------------------------------------------- @@ -88,7 +88,7 @@ class CycleClockSource { }; } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_CYCLECLOCK_H_ +#endif // Y_ABSL_BASE_INTERNAL_CYCLECLOCK_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/direct_mmap.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/direct_mmap.h index 82be9f94ab..805ae82873 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/direct_mmap.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/direct_mmap.h @@ -15,12 +15,12 @@ // Functions for directly invoking mmap() via syscall, avoiding the case where // mmap() has been locally overridden. -#ifndef ABSL_BASE_INTERNAL_DIRECT_MMAP_H_ -#define ABSL_BASE_INTERNAL_DIRECT_MMAP_H_ +#ifndef Y_ABSL_BASE_INTERNAL_DIRECT_MMAP_H_ +#define Y_ABSL_BASE_INTERNAL_DIRECT_MMAP_H_ #include "y_absl/base/config.h" -#if ABSL_HAVE_MMAP +#if Y_ABSL_HAVE_MMAP #include <sys/mman.h> @@ -66,7 +66,7 @@ extern "C" void* __mmap2(void*, size_t, int, int, int, size_t); #endif namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // Platform specific logic extracted from @@ -137,7 +137,7 @@ inline int DirectMunmap(void* start, size_t length) { } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl #else // !__linux__ @@ -146,7 +146,7 @@ ABSL_NAMESPACE_END // actual mmap()/munmap() methods. namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { inline void* DirectMmap(void* start, size_t length, int prot, int flags, int fd, @@ -159,11 +159,11 @@ inline int DirectMunmap(void* start, size_t length) { } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl #endif // __linux__ -#endif // ABSL_HAVE_MMAP +#endif // Y_ABSL_HAVE_MMAP -#endif // ABSL_BASE_INTERNAL_DIRECT_MMAP_H_ +#endif // Y_ABSL_BASE_INTERNAL_DIRECT_MMAP_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/dynamic_annotations.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/dynamic_annotations.h index 75f0022683..2ac2679133 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/dynamic_annotations.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/dynamic_annotations.h @@ -42,8 +42,8 @@ // If neither Dynamic Annotations nor Clang thread-safety warnings are // enabled, then all annotation-macros expand to empty. -#ifndef ABSL_BASE_INTERNAL_DYNAMIC_ANNOTATIONS_H_ -#define ABSL_BASE_INTERNAL_DYNAMIC_ANNOTATIONS_H_ +#ifndef Y_ABSL_BASE_INTERNAL_DYNAMIC_ANNOTATIONS_H_ +#define Y_ABSL_BASE_INTERNAL_DYNAMIC_ANNOTATIONS_H_ #include <stddef.h> @@ -57,22 +57,22 @@ #endif #if defined(__clang__) && !defined(SWIG) -#define ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED 1 +#define Y_ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED 1 #endif #if DYNAMIC_ANNOTATIONS_ENABLED != 0 -#define ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 1 -#define ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 1 -#define ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 1 -#define ABSL_INTERNAL_ANNOTALYSIS_ENABLED 0 -#define ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED 1 +#define Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 1 +#define Y_ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 1 +#define Y_ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 1 +#define Y_ABSL_INTERNAL_ANNOTALYSIS_ENABLED 0 +#define Y_ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED 1 #else -#define ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 0 -#define ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 0 -#define ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 0 +#define Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED 0 +#define Y_ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED 0 +#define Y_ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED 0 // Clang provides limited support for static thread-safety analysis through a // feature called Annotalysis. We configure macro-definitions according to @@ -81,38 +81,38 @@ // when compiling using Clang. // ANNOTALYSIS_ENABLED == 1 when IGNORE_READ_ATTRIBUTE_ENABLED == 1 -#define ABSL_INTERNAL_ANNOTALYSIS_ENABLED \ - defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) +#define Y_ABSL_INTERNAL_ANNOTALYSIS_ENABLED \ + defined(Y_ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) // Read/write annotations are enabled in Annotalysis mode; disabled otherwise. -#define ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED \ - ABSL_INTERNAL_ANNOTALYSIS_ENABLED +#define Y_ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED \ + Y_ABSL_INTERNAL_ANNOTALYSIS_ENABLED #endif // Memory annotations are also made available to LLVM's Memory Sanitizer -#if defined(ABSL_HAVE_MEMORY_SANITIZER) && !defined(__native_client__) -#define ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED 1 +#if defined(Y_ABSL_HAVE_MEMORY_SANITIZER) && !defined(__native_client__) +#define Y_ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED 1 #endif -#ifndef ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED -#define ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED 0 +#ifndef Y_ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED +#define Y_ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED 0 #endif #ifdef __cplusplus -#define ABSL_INTERNAL_BEGIN_EXTERN_C extern "C" { -#define ABSL_INTERNAL_END_EXTERN_C } // extern "C" -#define ABSL_INTERNAL_GLOBAL_SCOPED(F) ::F -#define ABSL_INTERNAL_STATIC_INLINE inline +#define Y_ABSL_INTERNAL_BEGIN_EXTERN_C extern "C" { +#define Y_ABSL_INTERNAL_END_EXTERN_C } // extern "C" +#define Y_ABSL_INTERNAL_GLOBAL_SCOPED(F) ::F +#define Y_ABSL_INTERNAL_STATIC_INLINE inline #else -#define ABSL_INTERNAL_BEGIN_EXTERN_C // empty -#define ABSL_INTERNAL_END_EXTERN_C // empty -#define ABSL_INTERNAL_GLOBAL_SCOPED(F) F -#define ABSL_INTERNAL_STATIC_INLINE static inline +#define Y_ABSL_INTERNAL_BEGIN_EXTERN_C // empty +#define Y_ABSL_INTERNAL_END_EXTERN_C // empty +#define Y_ABSL_INTERNAL_GLOBAL_SCOPED(F) F +#define Y_ABSL_INTERNAL_STATIC_INLINE static inline #endif // ------------------------------------------------------------------------- // Define race annotations. -#if ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 1 +#if Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 1 // ------------------------------------------------------------- // Annotations that suppress errors. It is usually better to express the @@ -124,20 +124,20 @@ // point where `pointer` has been allocated, preferably close to the point // where the race happens. See also ANNOTATE_BENIGN_RACE_STATIC. #define ANNOTATE_BENIGN_RACE(pointer, description) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \ (__FILE__, __LINE__, pointer, sizeof(*(pointer)), description) // Same as ANNOTATE_BENIGN_RACE(`address`, `description`), but applies to // the memory range [`address`, `address`+`size`). #define ANNOTATE_BENIGN_RACE_SIZED(address, size, description) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateBenignRaceSized) \ (__FILE__, __LINE__, address, size, description) // Enable (`enable`!=0) or disable (`enable`==0) race detection for all threads. // This annotation could be useful if you want to skip expensive race analysis // during some period of program execution, e.g. during initialization. #define ANNOTATE_ENABLE_RACE_DETECTION(enable) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateEnableRaceDetection) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateEnableRaceDetection) \ (__FILE__, __LINE__, enable) // ------------------------------------------------------------- @@ -145,7 +145,7 @@ // Report the current thread `name` to a race detector. #define ANNOTATE_THREAD_NAME(name) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateThreadName)(__FILE__, __LINE__, name) + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateThreadName)(__FILE__, __LINE__, name) // ------------------------------------------------------------- // Annotations useful when implementing locks. They are not normally needed by @@ -154,12 +154,12 @@ // Report that a lock has been created at address `lock`. #define ANNOTATE_RWLOCK_CREATE(lock) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreate)(__FILE__, __LINE__, lock) + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreate)(__FILE__, __LINE__, lock) // Report that a linker initialized lock has been created at address `lock`. -#ifdef ABSL_HAVE_THREAD_SANITIZER +#ifdef Y_ABSL_HAVE_THREAD_SANITIZER #define ANNOTATE_RWLOCK_CREATE_STATIC(lock) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreateStatic) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockCreateStatic) \ (__FILE__, __LINE__, lock) #else #define ANNOTATE_RWLOCK_CREATE_STATIC(lock) ANNOTATE_RWLOCK_CREATE(lock) @@ -167,18 +167,18 @@ // Report that the lock at address `lock` is about to be destroyed. #define ANNOTATE_RWLOCK_DESTROY(lock) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockDestroy)(__FILE__, __LINE__, lock) + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockDestroy)(__FILE__, __LINE__, lock) // Report that the lock at address `lock` has been acquired. // `is_w`=1 for writer lock, `is_w`=0 for reader lock. #define ANNOTATE_RWLOCK_ACQUIRED(lock, is_w) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockAcquired) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockAcquired) \ (__FILE__, __LINE__, lock, is_w) // Report that the lock at address `lock` is about to be released. // `is_w`=1 for writer lock, `is_w`=0 for reader lock. #define ANNOTATE_RWLOCK_RELEASED(lock, is_w) \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockReleased) \ + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateRWLockReleased) \ (__FILE__, __LINE__, lock, is_w) // Apply ANNOTATE_BENIGN_RACE_SIZED to a static variable `static_var`. @@ -194,7 +194,7 @@ static static_var##_annotator the##static_var##_annotator; \ } // namespace -#else // ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 0 +#else // Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED == 0 #define ANNOTATE_RWLOCK_CREATE(lock) // empty #define ANNOTATE_RWLOCK_CREATE_STATIC(lock) // empty @@ -207,12 +207,12 @@ #define ANNOTATE_ENABLE_RACE_DETECTION(enable) // empty #define ANNOTATE_BENIGN_RACE_STATIC(static_var, description) // empty -#endif // ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED +#endif // Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED // ------------------------------------------------------------------------- // Define memory annotations. -#if ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED == 1 +#if Y_ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED == 1 #include <sanitizer/msan_interface.h> @@ -222,7 +222,7 @@ #define ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) \ __msan_allocated_memory(address, size) -#else // ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED == 0 +#else // Y_ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED == 0 #if DYNAMIC_ANNOTATIONS_ENABLED == 1 #define ANNOTATE_MEMORY_IS_INITIALIZED(address, size) \ @@ -240,42 +240,42 @@ #define ANNOTATE_MEMORY_IS_UNINITIALIZED(address, size) // empty #endif -#endif // ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED +#endif // Y_ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED // ------------------------------------------------------------------------- // Define IGNORE_READS_BEGIN/_END attributes. -#if defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) +#if defined(Y_ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) -#define ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE \ +#define Y_ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE \ __attribute((exclusive_lock_function("*"))) -#define ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE \ +#define Y_ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE \ __attribute((unlock_function("*"))) -#else // !defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) +#else // !defined(Y_ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) -#define ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE // empty -#define ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE // empty +#define Y_ABSL_INTERNAL_IGNORE_READS_BEGIN_ATTRIBUTE // empty +#define Y_ABSL_INTERNAL_IGNORE_READS_END_ATTRIBUTE // empty -#endif // defined(ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) +#endif // defined(Y_ABSL_INTERNAL_IGNORE_READS_ATTRIBUTE_ENABLED) // ------------------------------------------------------------------------- // Define IGNORE_READS_BEGIN/_END annotations. -#if ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED == 1 +#if Y_ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED == 1 // Request the analysis tool to ignore all reads in the current thread until // ANNOTATE_IGNORE_READS_END is called. Useful to ignore intentional racey // reads, while still checking other reads and all writes. // See also ANNOTATE_UNPROTECTED_READ. #define ANNOTATE_IGNORE_READS_BEGIN() \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsBegin)(__FILE__, __LINE__) + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsBegin)(__FILE__, __LINE__) // Stop ignoring reads. #define ANNOTATE_IGNORE_READS_END() \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsEnd)(__FILE__, __LINE__) + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreReadsEnd)(__FILE__, __LINE__) -#elif defined(ABSL_INTERNAL_ANNOTALYSIS_ENABLED) +#elif defined(Y_ABSL_INTERNAL_ANNOTALYSIS_ENABLED) // When Annotalysis is enabled without Dynamic Annotations, the use of // static-inline functions allows the annotations to be read at compile-time, @@ -285,10 +285,10 @@ // allows IGNORE_READS_AND_WRITES to work properly. #define ANNOTATE_IGNORE_READS_BEGIN() \ - ABSL_INTERNAL_GLOBAL_SCOPED(AbslInternalAnnotateIgnoreReadsBegin)() + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AbslInternalAnnotateIgnoreReadsBegin)() #define ANNOTATE_IGNORE_READS_END() \ - ABSL_INTERNAL_GLOBAL_SCOPED(AbslInternalAnnotateIgnoreReadsEnd)() + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AbslInternalAnnotateIgnoreReadsEnd)() #else @@ -300,15 +300,15 @@ // ------------------------------------------------------------------------- // Define IGNORE_WRITES_BEGIN/_END annotations. -#if ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED == 1 +#if Y_ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED == 1 // Similar to ANNOTATE_IGNORE_READS_BEGIN, but ignore writes instead. #define ANNOTATE_IGNORE_WRITES_BEGIN() \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesBegin)(__FILE__, __LINE__) + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesBegin)(__FILE__, __LINE__) // Stop ignoring writes. #define ANNOTATE_IGNORE_WRITES_END() \ - ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesEnd)(__FILE__, __LINE__) + Y_ABSL_INTERNAL_GLOBAL_SCOPED(AnnotateIgnoreWritesEnd)(__FILE__, __LINE__) #else @@ -328,7 +328,7 @@ // one can use // ... = ANNOTATE_UNPROTECTED_READ(x); -#if defined(ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED) +#if defined(Y_ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED) // Start ignoring all memory accesses (both reads and writes). #define ANNOTATE_IGNORE_READS_AND_WRITES_BEGIN() \ @@ -362,7 +362,7 @@ // ------------------------------------------------------------------------- // Address sanitizer annotations -#ifdef ABSL_HAVE_ADDRESS_SANITIZER +#ifdef Y_ABSL_HAVE_ADDRESS_SANITIZER // Describe the current state of a contiguous container such as e.g. // std::vector or TString. For more details see // sanitizer/common_interface_defs.h, which is provided by the compiler. @@ -380,19 +380,19 @@ #define ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid) #define ADDRESS_SANITIZER_REDZONE(name) static_assert(true, "") -#endif // ABSL_HAVE_ADDRESS_SANITIZER +#endif // Y_ABSL_HAVE_ADDRESS_SANITIZER // ------------------------------------------------------------------------- // Undefine the macros intended only for this file. -#undef ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED -#undef ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED -#undef ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED -#undef ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED -#undef ABSL_INTERNAL_ANNOTALYSIS_ENABLED -#undef ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED -#undef ABSL_INTERNAL_BEGIN_EXTERN_C -#undef ABSL_INTERNAL_END_EXTERN_C -#undef ABSL_INTERNAL_STATIC_INLINE - -#endif // ABSL_BASE_INTERNAL_DYNAMIC_ANNOTATIONS_H_ +#undef Y_ABSL_INTERNAL_RACE_ANNOTATIONS_ENABLED +#undef Y_ABSL_INTERNAL_MEMORY_ANNOTATIONS_ENABLED +#undef Y_ABSL_INTERNAL_READS_ANNOTATIONS_ENABLED +#undef Y_ABSL_INTERNAL_WRITES_ANNOTATIONS_ENABLED +#undef Y_ABSL_INTERNAL_ANNOTALYSIS_ENABLED +#undef Y_ABSL_INTERNAL_READS_WRITES_ANNOTATIONS_ENABLED +#undef Y_ABSL_INTERNAL_BEGIN_EXTERN_C +#undef Y_ABSL_INTERNAL_END_EXTERN_C +#undef Y_ABSL_INTERNAL_STATIC_INLINE + +#endif // Y_ABSL_BASE_INTERNAL_DYNAMIC_ANNOTATIONS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/endian.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/endian.h index 0f7adb8bf6..d450704225 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/endian.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/endian.h @@ -13,8 +13,8 @@ // limitations under the License. // -#ifndef ABSL_BASE_INTERNAL_ENDIAN_H_ -#define ABSL_BASE_INTERNAL_ENDIAN_H_ +#ifndef Y_ABSL_BASE_INTERNAL_ENDIAN_H_ +#define Y_ABSL_BASE_INTERNAL_ENDIAN_H_ // The following guarantees declaration of the byte swap functions #ifdef _MSC_VER @@ -32,7 +32,7 @@ #include "y_absl/base/port.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN // Use compiler byte-swapping intrinsics if they are available. 32-bit // and 64-bit versions are available in Clang and GCC as of GCC 4.3.0. @@ -109,7 +109,7 @@ inline uint16_t gbswap_16(uint16_t host_int) { #endif // intrinsics available -#ifdef ABSL_IS_LITTLE_ENDIAN +#ifdef Y_ABSL_IS_LITTLE_ENDIAN // Definitions for ntohl etc. that don't require us to include // netinet/in.h. We wrap gbswap_32 and gbswap_16 in functions rather @@ -121,7 +121,7 @@ inline uint16_t ghtons(uint16_t x) { return gbswap_16(x); } inline uint32_t ghtonl(uint32_t x) { return gbswap_32(x); } inline uint64_t ghtonll(uint64_t x) { return gbswap_64(x); } -#elif defined ABSL_IS_BIG_ENDIAN +#elif defined Y_ABSL_IS_BIG_ENDIAN // These definitions are simpler on big-endian machines // These are functions instead of macros to avoid self-assignment warnings @@ -132,8 +132,8 @@ inline uint64_t ghtonll(uint64_t x) { return x; } #else #error \ - "Unsupported byte order: Either ABSL_IS_BIG_ENDIAN or " \ - "ABSL_IS_LITTLE_ENDIAN must be defined" + "Unsupported byte order: Either Y_ABSL_IS_BIG_ENDIAN or " \ + "Y_ABSL_IS_LITTLE_ENDIAN must be defined" #endif // byte order inline uint16_t gntohs(uint16_t x) { return ghtons(x); } @@ -146,7 +146,7 @@ inline uint64_t gntohll(uint64_t x) { return ghtonll(x); } // Load/Store methods are alignment safe namespace little_endian { // Conversion functions. -#ifdef ABSL_IS_LITTLE_ENDIAN +#ifdef Y_ABSL_IS_LITTLE_ENDIAN inline uint16_t FromHost16(uint16_t x) { return x; } inline uint16_t ToHost16(uint16_t x) { return x; } @@ -159,7 +159,7 @@ inline uint64_t ToHost64(uint64_t x) { return x; } inline constexpr bool IsLittleEndian() { return true; } -#elif defined ABSL_IS_BIG_ENDIAN +#elif defined Y_ABSL_IS_BIG_ENDIAN inline uint16_t FromHost16(uint16_t x) { return gbswap_16(x); } inline uint16_t ToHost16(uint16_t x) { return gbswap_16(x); } @@ -206,27 +206,27 @@ inline int64_t ToHost(int64_t x) { // Functions to do unaligned loads and stores in little-endian order. inline uint16_t Load16(const void *p) { - return ToHost16(ABSL_INTERNAL_UNALIGNED_LOAD16(p)); + return ToHost16(Y_ABSL_INTERNAL_UNALIGNED_LOAD16(p)); } inline void Store16(void *p, uint16_t v) { - ABSL_INTERNAL_UNALIGNED_STORE16(p, FromHost16(v)); + Y_ABSL_INTERNAL_UNALIGNED_STORE16(p, FromHost16(v)); } inline uint32_t Load32(const void *p) { - return ToHost32(ABSL_INTERNAL_UNALIGNED_LOAD32(p)); + return ToHost32(Y_ABSL_INTERNAL_UNALIGNED_LOAD32(p)); } inline void Store32(void *p, uint32_t v) { - ABSL_INTERNAL_UNALIGNED_STORE32(p, FromHost32(v)); + Y_ABSL_INTERNAL_UNALIGNED_STORE32(p, FromHost32(v)); } inline uint64_t Load64(const void *p) { - return ToHost64(ABSL_INTERNAL_UNALIGNED_LOAD64(p)); + return ToHost64(Y_ABSL_INTERNAL_UNALIGNED_LOAD64(p)); } inline void Store64(void *p, uint64_t v) { - ABSL_INTERNAL_UNALIGNED_STORE64(p, FromHost64(v)); + Y_ABSL_INTERNAL_UNALIGNED_STORE64(p, FromHost64(v)); } } // namespace little_endian @@ -236,7 +236,7 @@ inline void Store64(void *p, uint64_t v) { // // Load/Store methods are alignment safe namespace big_endian { -#ifdef ABSL_IS_LITTLE_ENDIAN +#ifdef Y_ABSL_IS_LITTLE_ENDIAN inline uint16_t FromHost16(uint16_t x) { return gbswap_16(x); } inline uint16_t ToHost16(uint16_t x) { return gbswap_16(x); } @@ -249,7 +249,7 @@ inline uint64_t ToHost64(uint64_t x) { return gbswap_64(x); } inline constexpr bool IsLittleEndian() { return true; } -#elif defined ABSL_IS_BIG_ENDIAN +#elif defined Y_ABSL_IS_BIG_ENDIAN inline uint16_t FromHost16(uint16_t x) { return x; } inline uint16_t ToHost16(uint16_t x) { return x; } @@ -296,32 +296,32 @@ inline int64_t ToHost(int64_t x) { // Functions to do unaligned loads and stores in big-endian order. inline uint16_t Load16(const void *p) { - return ToHost16(ABSL_INTERNAL_UNALIGNED_LOAD16(p)); + return ToHost16(Y_ABSL_INTERNAL_UNALIGNED_LOAD16(p)); } inline void Store16(void *p, uint16_t v) { - ABSL_INTERNAL_UNALIGNED_STORE16(p, FromHost16(v)); + Y_ABSL_INTERNAL_UNALIGNED_STORE16(p, FromHost16(v)); } inline uint32_t Load32(const void *p) { - return ToHost32(ABSL_INTERNAL_UNALIGNED_LOAD32(p)); + return ToHost32(Y_ABSL_INTERNAL_UNALIGNED_LOAD32(p)); } inline void Store32(void *p, uint32_t v) { - ABSL_INTERNAL_UNALIGNED_STORE32(p, FromHost32(v)); + Y_ABSL_INTERNAL_UNALIGNED_STORE32(p, FromHost32(v)); } inline uint64_t Load64(const void *p) { - return ToHost64(ABSL_INTERNAL_UNALIGNED_LOAD64(p)); + return ToHost64(Y_ABSL_INTERNAL_UNALIGNED_LOAD64(p)); } inline void Store64(void *p, uint64_t v) { - ABSL_INTERNAL_UNALIGNED_STORE64(p, FromHost64(v)); + Y_ABSL_INTERNAL_UNALIGNED_STORE64(p, FromHost64(v)); } } // namespace big_endian -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_ENDIAN_H_ +#endif // Y_ABSL_BASE_INTERNAL_ENDIAN_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/errno_saver.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/errno_saver.h index 94202a4ed6..6221958769 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/errno_saver.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/errno_saver.h @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_BASE_INTERNAL_ERRNO_SAVER_H_ -#define ABSL_BASE_INTERNAL_ERRNO_SAVER_H_ +#ifndef Y_ABSL_BASE_INTERNAL_ERRNO_SAVER_H_ +#define Y_ABSL_BASE_INTERNAL_ERRNO_SAVER_H_ #include <cerrno> #include "y_absl/base/config.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // `ErrnoSaver` captures the value of `errno` upon construction and restores it @@ -37,7 +37,7 @@ class ErrnoSaver { }; } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_ERRNO_SAVER_H_ +#endif // Y_ABSL_BASE_INTERNAL_ERRNO_SAVER_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/exception_safety_testing.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/exception_safety_testing.h index 3009f17875..1e33f3bee9 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/exception_safety_testing.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/exception_safety_testing.h @@ -14,12 +14,12 @@ // Utilities for testing exception-safety -#ifndef ABSL_BASE_INTERNAL_EXCEPTION_SAFETY_TESTING_H_ -#define ABSL_BASE_INTERNAL_EXCEPTION_SAFETY_TESTING_H_ +#ifndef Y_ABSL_BASE_INTERNAL_EXCEPTION_SAFETY_TESTING_H_ +#define Y_ABSL_BASE_INTERNAL_EXCEPTION_SAFETY_TESTING_H_ #include "y_absl/base/config.h" -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS #include <cstddef> #include <cstdint> @@ -214,7 +214,7 @@ class ThrowingBool { public: ThrowingBool(bool b) noexcept : b_(b) {} // NOLINT(runtime/explicit) operator bool() const { // NOLINT - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return b_; } @@ -264,7 +264,7 @@ class ThrowingValue : private exceptions_internal::TrackedObject { public: ThrowingValue() : TrackedObject(GetInstanceString(kDefaultValue)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ = kDefaultValue; } @@ -272,7 +272,7 @@ class ThrowingValue : private exceptions_internal::TrackedObject { IsSpecified(TypeSpec::kNoThrowCopy)) : TrackedObject(GetInstanceString(other.dummy_)) { if (!IsSpecified(TypeSpec::kNoThrowCopy)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); } dummy_ = other.dummy_; } @@ -281,13 +281,13 @@ class ThrowingValue : private exceptions_internal::TrackedObject { IsSpecified(TypeSpec::kNoThrowMove)) : TrackedObject(GetInstanceString(other.dummy_)) { if (!IsSpecified(TypeSpec::kNoThrowMove)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); } dummy_ = other.dummy_; } explicit ThrowingValue(int i) : TrackedObject(GetInstanceString(i)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ = i; } @@ -301,7 +301,7 @@ class ThrowingValue : private exceptions_internal::TrackedObject { IsSpecified(TypeSpec::kNoThrowCopy)) { dummy_ = kBadValue; if (!IsSpecified(TypeSpec::kNoThrowCopy)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); } dummy_ = other.dummy_; return *this; @@ -311,7 +311,7 @@ class ThrowingValue : private exceptions_internal::TrackedObject { IsSpecified(TypeSpec::kNoThrowMove)) { dummy_ = kBadValue; if (!IsSpecified(TypeSpec::kNoThrowMove)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); } dummy_ = other.dummy_; return *this; @@ -319,73 +319,73 @@ class ThrowingValue : private exceptions_internal::TrackedObject { // Arithmetic Operators ThrowingValue operator+(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(dummy_ + other.dummy_, nothrow_ctor); } ThrowingValue operator+() const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(dummy_, nothrow_ctor); } ThrowingValue operator-(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(dummy_ - other.dummy_, nothrow_ctor); } ThrowingValue operator-() const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(-dummy_, nothrow_ctor); } ThrowingValue& operator++() { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); ++dummy_; return *this; } ThrowingValue operator++(int) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); auto out = ThrowingValue(dummy_, nothrow_ctor); ++dummy_; return out; } ThrowingValue& operator--() { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); --dummy_; return *this; } ThrowingValue operator--(int) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); auto out = ThrowingValue(dummy_, nothrow_ctor); --dummy_; return out; } ThrowingValue operator*(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(dummy_ * other.dummy_, nothrow_ctor); } ThrowingValue operator/(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(dummy_ / other.dummy_, nothrow_ctor); } ThrowingValue operator%(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(dummy_ % other.dummy_, nothrow_ctor); } ThrowingValue operator<<(int shift) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(dummy_ << shift, nothrow_ctor); } ThrowingValue operator>>(int shift) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(dummy_ >> shift, nothrow_ctor); } @@ -394,129 +394,129 @@ class ThrowingValue : private exceptions_internal::TrackedObject { // types/containers requires T to be convertible to bool. friend ThrowingBool operator==(const ThrowingValue& a, const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return a.dummy_ == b.dummy_; } friend ThrowingBool operator!=(const ThrowingValue& a, const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return a.dummy_ != b.dummy_; } friend ThrowingBool operator<(const ThrowingValue& a, const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return a.dummy_ < b.dummy_; } friend ThrowingBool operator<=(const ThrowingValue& a, const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return a.dummy_ <= b.dummy_; } friend ThrowingBool operator>(const ThrowingValue& a, const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return a.dummy_ > b.dummy_; } friend ThrowingBool operator>=(const ThrowingValue& a, const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return a.dummy_ >= b.dummy_; } // Logical Operators ThrowingBool operator!() const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return !dummy_; } ThrowingBool operator&&(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return dummy_ && other.dummy_; } ThrowingBool operator||(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return dummy_ || other.dummy_; } // Bitwise Logical Operators ThrowingValue operator~() const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(~dummy_, nothrow_ctor); } ThrowingValue operator&(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(dummy_ & other.dummy_, nothrow_ctor); } ThrowingValue operator|(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(dummy_ | other.dummy_, nothrow_ctor); } ThrowingValue operator^(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return ThrowingValue(dummy_ ^ other.dummy_, nothrow_ctor); } // Compound Assignment operators ThrowingValue& operator+=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ += other.dummy_; return *this; } ThrowingValue& operator-=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ -= other.dummy_; return *this; } ThrowingValue& operator*=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ *= other.dummy_; return *this; } ThrowingValue& operator/=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ /= other.dummy_; return *this; } ThrowingValue& operator%=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ %= other.dummy_; return *this; } ThrowingValue& operator&=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ &= other.dummy_; return *this; } ThrowingValue& operator|=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ |= other.dummy_; return *this; } ThrowingValue& operator^=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ ^= other.dummy_; return *this; } ThrowingValue& operator<<=(int shift) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ <<= shift; return *this; } ThrowingValue& operator>>=(int shift) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ >>= shift; return *this; } @@ -526,12 +526,12 @@ class ThrowingValue : private exceptions_internal::TrackedObject { // Stream operators friend std::ostream& operator<<(std::ostream& os, const ThrowingValue& tv) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return os << GetInstanceString(tv.dummy_); } friend std::istream& operator>>(std::istream& is, const ThrowingValue&) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); return is; } @@ -539,7 +539,7 @@ class ThrowingValue : private exceptions_internal::TrackedObject { static void* operator new(size_t s) noexcept( IsSpecified(TypeSpec::kNoThrowNew)) { if (!IsSpecified(TypeSpec::kNoThrowNew)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION, true); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION, true); } return ::operator new(s); } @@ -547,7 +547,7 @@ class ThrowingValue : private exceptions_internal::TrackedObject { static void* operator new[](size_t s) noexcept( IsSpecified(TypeSpec::kNoThrowNew)) { if (!IsSpecified(TypeSpec::kNoThrowNew)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION, true); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION, true); } return ::operator new[](s); } @@ -556,7 +556,7 @@ class ThrowingValue : private exceptions_internal::TrackedObject { static void* operator new(size_t s, Args&&... args) noexcept( IsSpecified(TypeSpec::kNoThrowNew)) { if (!IsSpecified(TypeSpec::kNoThrowNew)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION, true); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION, true); } return ::operator new(s, std::forward<Args>(args)...); } @@ -565,7 +565,7 @@ class ThrowingValue : private exceptions_internal::TrackedObject { static void* operator new[](size_t s, Args&&... args) noexcept( IsSpecified(TypeSpec::kNoThrowNew)) { if (!IsSpecified(TypeSpec::kNoThrowNew)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION, true); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION, true); } return ::operator new[](s, std::forward<Args>(args)...); } @@ -623,7 +623,7 @@ enum class AllocSpec { * An allocator type which is instrumented to throw at a controlled time, or not * to throw, using AllocSpec. The supported settings are the default of every * function which is allowed to throw in a conforming allocator possibly - * throwing, or nothing throws, in line with the ABSL_ALLOCATOR_THROWS + * throwing, or nothing throws, in line with the Y_ABSL_ALLOCATOR_THROWS * configuration macro. */ template <typename T, AllocSpec Spec = AllocSpec::kEverythingThrows> @@ -651,7 +651,7 @@ class ThrowingAllocator : private exceptions_internal::TrackedObject { using is_always_equal = std::false_type; ThrowingAllocator() : TrackedObject(GetInstanceString(next_id_)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); + exceptions_internal::MaybeThrow(Y_ABSL_PRETTY_FUNCTION); dummy_ = std::make_shared<const int>(next_id_++); } @@ -702,7 +702,7 @@ class ThrowingAllocator : private exceptions_internal::TrackedObject { pointer allocate(size_type n) noexcept( IsSpecified(AllocSpec::kNoThrowAllocate)) { - ReadStateAndMaybeThrow(ABSL_PRETTY_FUNCTION); + ReadStateAndMaybeThrow(Y_ABSL_PRETTY_FUNCTION); return static_cast<pointer>(::operator new(n * sizeof(T))); } @@ -719,7 +719,7 @@ class ThrowingAllocator : private exceptions_internal::TrackedObject { template <typename U, typename... Args> void construct(U* ptr, Args&&... args) noexcept( IsSpecified(AllocSpec::kNoThrowAllocate)) { - ReadStateAndMaybeThrow(ABSL_PRETTY_FUNCTION); + ReadStateAndMaybeThrow(Y_ABSL_PRETTY_FUNCTION); ::new (static_cast<void*>(ptr)) U(std::forward<Args>(args)...); } @@ -735,7 +735,7 @@ class ThrowingAllocator : private exceptions_internal::TrackedObject { ThrowingAllocator select_on_container_copy_construction() noexcept( IsSpecified(AllocSpec::kNoThrowAllocate)) { - ReadStateAndMaybeThrow(ABSL_PRETTY_FUNCTION); + ReadStateAndMaybeThrow(Y_ABSL_PRETTY_FUNCTION); return *this; } @@ -1104,6 +1104,6 @@ class ExceptionSafetyTestBuilder { } // namespace testing -#endif // ABSL_HAVE_EXCEPTIONS +#endif // Y_ABSL_HAVE_EXCEPTIONS -#endif // ABSL_BASE_INTERNAL_EXCEPTION_SAFETY_TESTING_H_ +#endif // Y_ABSL_BASE_INTERNAL_EXCEPTION_SAFETY_TESTING_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/exception_testing.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/exception_testing.h index f2dd04b9d6..0e9696ffa4 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/exception_testing.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/exception_testing.h @@ -14,29 +14,29 @@ // Testing utilities for ABSL types which throw exceptions. -#ifndef ABSL_BASE_INTERNAL_EXCEPTION_TESTING_H_ -#define ABSL_BASE_INTERNAL_EXCEPTION_TESTING_H_ +#ifndef Y_ABSL_BASE_INTERNAL_EXCEPTION_TESTING_H_ +#define Y_ABSL_BASE_INTERNAL_EXCEPTION_TESTING_H_ #include "gtest/gtest.h" #include "y_absl/base/config.h" -// ABSL_BASE_INTERNAL_EXPECT_FAIL tests either for a specified thrown exception +// Y_ABSL_BASE_INTERNAL_EXPECT_FAIL tests either for a specified thrown exception // if exceptions are enabled, or for death with a specified text in the error // message -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS -#define ABSL_BASE_INTERNAL_EXPECT_FAIL(expr, exception_t, text) \ +#define Y_ABSL_BASE_INTERNAL_EXPECT_FAIL(expr, exception_t, text) \ EXPECT_THROW(expr, exception_t) #elif defined(__ANDROID__) // Android asserts do not log anywhere that gtest can currently inspect. // So we expect exit, but cannot match the message. -#define ABSL_BASE_INTERNAL_EXPECT_FAIL(expr, exception_t, text) \ +#define Y_ABSL_BASE_INTERNAL_EXPECT_FAIL(expr, exception_t, text) \ EXPECT_DEATH(expr, ".*") #else -#define ABSL_BASE_INTERNAL_EXPECT_FAIL(expr, exception_t, text) \ +#define Y_ABSL_BASE_INTERNAL_EXPECT_FAIL(expr, exception_t, text) \ EXPECT_DEATH_IF_SUPPORTED(expr, text) #endif -#endif // ABSL_BASE_INTERNAL_EXCEPTION_TESTING_H_ +#endif // Y_ABSL_BASE_INTERNAL_EXCEPTION_TESTING_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/fast_type_id.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/fast_type_id.h index c82cba7b4a..4fa0cf8ea6 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/fast_type_id.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/fast_type_id.h @@ -14,13 +14,13 @@ // limitations under the License. // -#ifndef ABSL_BASE_INTERNAL_FAST_TYPE_ID_H_ -#define ABSL_BASE_INTERNAL_FAST_TYPE_ID_H_ +#ifndef Y_ABSL_BASE_INTERNAL_FAST_TYPE_ID_H_ +#define Y_ABSL_BASE_INTERNAL_FAST_TYPE_ID_H_ #include "y_absl/base/config.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { template <typename Type> @@ -42,7 +42,7 @@ constexpr inline FastTypeIdType FastTypeId() { } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_FAST_TYPE_ID_H_ +#endif // Y_ABSL_BASE_INTERNAL_FAST_TYPE_ID_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/hide_ptr.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/hide_ptr.h index ccdad25cb7..1bd356cffd 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/hide_ptr.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/hide_ptr.h @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_BASE_INTERNAL_HIDE_PTR_H_ -#define ABSL_BASE_INTERNAL_HIDE_PTR_H_ +#ifndef Y_ABSL_BASE_INTERNAL_HIDE_PTR_H_ +#define Y_ABSL_BASE_INTERNAL_HIDE_PTR_H_ #include <cstdint> #include "y_absl/base/config.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // Arbitrary value with high bits set. Xor'ing with it is unlikely @@ -45,7 +45,7 @@ inline T* UnhidePtr(uintptr_t hidden) { } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_HIDE_PTR_H_ +#endif // Y_ABSL_BASE_INTERNAL_HIDE_PTR_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/identity.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/identity.h index 2360afeed2..edf314d798 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/identity.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/identity.h @@ -13,13 +13,13 @@ // limitations under the License. // -#ifndef ABSL_BASE_INTERNAL_IDENTITY_H_ -#define ABSL_BASE_INTERNAL_IDENTITY_H_ +#ifndef Y_ABSL_BASE_INTERNAL_IDENTITY_H_ +#define Y_ABSL_BASE_INTERNAL_IDENTITY_H_ #include "y_absl/base/config.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace internal { template <typename T> @@ -31,7 +31,7 @@ template <typename T> using identity_t = typename identity<T>::type; } // namespace internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_IDENTITY_H_ +#endif // Y_ABSL_BASE_INTERNAL_IDENTITY_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable.h index 38799c5722..895727ec87 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_BASE_INTERNAL_INLINE_VARIABLE_EMULATION_H_ -#define ABSL_BASE_INTERNAL_INLINE_VARIABLE_EMULATION_H_ +#ifndef Y_ABSL_BASE_INTERNAL_INLINE_VARIABLE_EMULATION_H_ +#define Y_ABSL_BASE_INTERNAL_INLINE_VARIABLE_EMULATION_H_ #include <type_traits> @@ -24,7 +24,7 @@ // inline variables based on whether or not the feature is supported. //////////////////////////////////////////////////////////////////////////////// -// Macro: ABSL_INTERNAL_INLINE_CONSTEXPR(type, name, init) +// Macro: Y_ABSL_INTERNAL_INLINE_CONSTEXPR(type, name, init) // // Description: // Expands to the equivalent of an inline constexpr instance of the specified @@ -44,7 +44,7 @@ // Usage: // // // Equivalent to: `inline constexpr size_t variant_npos = -1;` -// ABSL_INTERNAL_INLINE_CONSTEXPR(size_t, variant_npos, -1); +// Y_ABSL_INTERNAL_INLINE_CONSTEXPR(size_t, variant_npos, -1); // // Differences in implementation: // For a direct, language-level inline variable, decltype(name) will be the @@ -67,15 +67,15 @@ // appropriate place for pointer types, reference types, function pointer // types, etc.. #if defined(__clang__) -#define ABSL_INTERNAL_EXTERN_DECL(type, name) \ +#define Y_ABSL_INTERNAL_EXTERN_DECL(type, name) \ extern const ::y_absl::internal::identity_t<type> name; #else // Otherwise, just define the macro to do nothing. -#define ABSL_INTERNAL_EXTERN_DECL(type, name) +#define Y_ABSL_INTERNAL_EXTERN_DECL(type, name) #endif // defined(__clang__) // See above comment at top of file for details. -#define ABSL_INTERNAL_INLINE_CONSTEXPR(type, name, init) \ - ABSL_INTERNAL_EXTERN_DECL(type, name) \ +#define Y_ABSL_INTERNAL_INLINE_CONSTEXPR(type, name, init) \ + Y_ABSL_INTERNAL_EXTERN_DECL(type, name) \ inline constexpr ::y_absl::internal::identity_t<type> name = init #else @@ -86,7 +86,7 @@ // identity_t is used here so that the const and name are in the // appropriate place for pointer types, reference types, function pointer // types, etc.. -#define ABSL_INTERNAL_INLINE_CONSTEXPR(var_type, name, init) \ +#define Y_ABSL_INTERNAL_INLINE_CONSTEXPR(var_type, name, init) \ template <class /*AbslInternalDummy*/ = void> \ struct AbslInternalInlineVariableHolder##name { \ static constexpr ::y_absl::internal::identity_t<var_type> kInstance = init; \ @@ -104,4 +104,4 @@ #endif // __cpp_inline_variables -#endif // ABSL_BASE_INTERNAL_INLINE_VARIABLE_EMULATION_H_ +#endif // Y_ABSL_BASE_INTERNAL_INLINE_VARIABLE_EMULATION_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable_testing.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable_testing.h index 190e74e643..a705cd6b60 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable_testing.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/inline_variable_testing.h @@ -12,26 +12,26 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_BASE_INLINE_VARIABLE_TESTING_H_ -#define ABSL_BASE_INLINE_VARIABLE_TESTING_H_ +#ifndef Y_ABSL_BASE_INLINE_VARIABLE_TESTING_H_ +#define Y_ABSL_BASE_INLINE_VARIABLE_TESTING_H_ #include "y_absl/base/internal/inline_variable.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace inline_variable_testing_internal { struct Foo { int value = 5; }; -ABSL_INTERNAL_INLINE_CONSTEXPR(Foo, inline_variable_foo, {}); -ABSL_INTERNAL_INLINE_CONSTEXPR(Foo, other_inline_variable_foo, {}); +Y_ABSL_INTERNAL_INLINE_CONSTEXPR(Foo, inline_variable_foo, {}); +Y_ABSL_INTERNAL_INLINE_CONSTEXPR(Foo, other_inline_variable_foo, {}); -ABSL_INTERNAL_INLINE_CONSTEXPR(int, inline_variable_int, 5); -ABSL_INTERNAL_INLINE_CONSTEXPR(int, other_inline_variable_int, 5); +Y_ABSL_INTERNAL_INLINE_CONSTEXPR(int, inline_variable_int, 5); +Y_ABSL_INTERNAL_INLINE_CONSTEXPR(int, other_inline_variable_int, 5); -ABSL_INTERNAL_INLINE_CONSTEXPR(void(*)(), inline_variable_fun_ptr, nullptr); +Y_ABSL_INTERNAL_INLINE_CONSTEXPR(void(*)(), inline_variable_fun_ptr, nullptr); const Foo& get_foo_a(); const Foo& get_foo_b(); @@ -40,7 +40,7 @@ const int& get_int_a(); const int& get_int_b(); } // namespace inline_variable_testing_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INLINE_VARIABLE_TESTING_H_ +#endif // Y_ABSL_BASE_INLINE_VARIABLE_TESTING_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/invoke.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/invoke.h index 928666ff44..5d5348c377 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/invoke.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/invoke.h @@ -32,8 +32,8 @@ // The implementation is SFINAE-friendly: substitution failure within invoke() // isn't an error. -#ifndef ABSL_BASE_INTERNAL_INVOKE_H_ -#define ABSL_BASE_INTERNAL_INVOKE_H_ +#ifndef Y_ABSL_BASE_INTERNAL_INVOKE_H_ +#define Y_ABSL_BASE_INTERNAL_INVOKE_H_ #include <algorithm> #include <type_traits> @@ -45,7 +45,7 @@ // top of this file for the API documentation. namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // The five classes below each implement one of the clauses from the definition @@ -181,7 +181,7 @@ invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) { std::forward<Args>(args)...); } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_INVOKE_H_ +#endif // Y_ABSL_BASE_INTERNAL_INVOKE_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.cc index 0c477d1b28..3d96472b27 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.cc @@ -31,7 +31,7 @@ // LowLevelAlloc requires that the platform support low-level // allocation of virtual memory. Platforms lacking this cannot use // LowLevelAlloc. -#ifndef ABSL_LOW_LEVEL_ALLOC_MISSING +#ifndef Y_ABSL_LOW_LEVEL_ALLOC_MISSING #ifndef _WIN32 #include <pthread.h> @@ -63,7 +63,7 @@ #endif // __APPLE__ namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // A first-fit allocator with amortized logarithmic free() time. @@ -145,7 +145,7 @@ static int LLA_SkiplistLevels(size_t size, size_t base, uint32_t *random) { int level = IntLog2(size, base) + (random != nullptr ? Random(random) : 1); if (static_cast<size_t>(level) > max_fit) level = static_cast<int>(max_fit); if (level > kMaxLevel-1) level = kMaxLevel - 1; - ABSL_RAW_CHECK(level >= 1, "block not big enough for even one level"); + Y_ABSL_RAW_CHECK(level >= 1, "block not big enough for even one level"); return level; } @@ -185,7 +185,7 @@ static void LLA_SkiplistInsert(AllocList *head, AllocList *e, static void LLA_SkiplistDelete(AllocList *head, AllocList *e, AllocList **prev) { AllocList *found = LLA_SkiplistSearch(head, e, prev); - ABSL_RAW_CHECK(e == found, "element not in freelist"); + Y_ABSL_RAW_CHECK(e == found, "element not in freelist"); for (int i = 0; i != e->levels && prev[i]->next[i] == e; i++) { prev[i]->next[i] = e->next[i]; } @@ -204,9 +204,9 @@ struct LowLevelAlloc::Arena { base_internal::SpinLock mu; // Head of free list, sorted by address - AllocList freelist ABSL_GUARDED_BY(mu); + AllocList freelist Y_ABSL_GUARDED_BY(mu); // Count of allocated blocks - int32_t allocation_count ABSL_GUARDED_BY(mu); + int32_t allocation_count Y_ABSL_GUARDED_BY(mu); // flags passed to NewArena const uint32_t flags; // Result of sysconf(_SC_PAGESIZE) @@ -216,7 +216,7 @@ struct LowLevelAlloc::Arena { // Smallest allocation block size const size_t min_size; // PRNG state - uint32_t random ABSL_GUARDED_BY(mu); + uint32_t random Y_ABSL_GUARDED_BY(mu); }; namespace { @@ -227,7 +227,7 @@ alignas(LowLevelAlloc::Arena) unsigned char default_arena_storage[sizeof( LowLevelAlloc::Arena)]; alignas(LowLevelAlloc::Arena) unsigned char unhooked_arena_storage[sizeof( LowLevelAlloc::Arena)]; -#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#ifndef Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING alignas( LowLevelAlloc::Arena) unsigned char unhooked_async_sig_safe_arena_storage [sizeof(LowLevelAlloc::Arena)]; @@ -241,7 +241,7 @@ void CreateGlobalArenas() { new (&default_arena_storage) LowLevelAlloc::Arena(LowLevelAlloc::kCallMallocHook); new (&unhooked_arena_storage) LowLevelAlloc::Arena(0); -#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#ifndef Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING new (&unhooked_async_sig_safe_arena_storage) LowLevelAlloc::Arena(LowLevelAlloc::kAsyncSignalSafe); #endif @@ -254,7 +254,7 @@ LowLevelAlloc::Arena* UnhookedArena() { return reinterpret_cast<LowLevelAlloc::Arena*>(&unhooked_arena_storage); } -#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#ifndef Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING // Returns a global arena that is async-signal safe. Used by NewArena() when // kAsyncSignalSafe is set. LowLevelAlloc::Arena *UnhookedAsyncSigSafeArena() { @@ -277,12 +277,12 @@ static const uintptr_t kMagicAllocated = 0x4c833e95U; static const uintptr_t kMagicUnallocated = ~kMagicAllocated; namespace { -class ABSL_SCOPED_LOCKABLE ArenaLock { +class Y_ABSL_SCOPED_LOCKABLE ArenaLock { public: explicit ArenaLock(LowLevelAlloc::Arena *arena) - ABSL_EXCLUSIVE_LOCK_FUNCTION(arena->mu) + Y_ABSL_EXCLUSIVE_LOCK_FUNCTION(arena->mu) : arena_(arena) { -#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#ifndef Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING if ((arena->flags & LowLevelAlloc::kAsyncSignalSafe) != 0) { sigset_t all; sigfillset(&all); @@ -291,14 +291,14 @@ class ABSL_SCOPED_LOCKABLE ArenaLock { #endif arena_->mu.Lock(); } - ~ArenaLock() { ABSL_RAW_CHECK(left_, "haven't left Arena region"); } - void Leave() ABSL_UNLOCK_FUNCTION() { + ~ArenaLock() { Y_ABSL_RAW_CHECK(left_, "haven't left Arena region"); } + void Leave() Y_ABSL_UNLOCK_FUNCTION() { arena_->mu.Unlock(); -#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#ifndef Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING if (mask_valid_) { const int err = pthread_sigmask(SIG_SETMASK, &mask_, nullptr); if (err != 0) { - ABSL_RAW_LOG(FATAL, "pthread_sigmask failed: %d", err); + Y_ABSL_RAW_LOG(FATAL, "pthread_sigmask failed: %d", err); } } #endif @@ -307,7 +307,7 @@ class ABSL_SCOPED_LOCKABLE ArenaLock { private: bool left_ = false; // whether left region -#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#ifndef Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING bool mask_valid_ = false; sigset_t mask_; // old mask of blocked signals #endif @@ -366,7 +366,7 @@ LowLevelAlloc::Arena::Arena(uint32_t flags_value) // L < meta_data_arena->mu LowLevelAlloc::Arena *LowLevelAlloc::NewArena(int32_t flags) { Arena *meta_data_arena = DefaultArena(); -#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#ifndef Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING if ((flags & LowLevelAlloc::kAsyncSignalSafe) != 0) { meta_data_arena = UnhookedAsyncSigSafeArena(); } else // NOLINT(readability/braces) @@ -381,7 +381,7 @@ LowLevelAlloc::Arena *LowLevelAlloc::NewArena(int32_t flags) { // L < arena->mu, L < arena->arena->mu bool LowLevelAlloc::DeleteArena(Arena *arena) { - ABSL_RAW_CHECK( + Y_ABSL_RAW_CHECK( arena != nullptr && arena != DefaultArena() && arena != UnhookedArena(), "may not delete default arena"); ArenaLock section(arena); @@ -393,22 +393,22 @@ bool LowLevelAlloc::DeleteArena(Arena *arena) { AllocList *region = arena->freelist.next[0]; size_t size = region->header.size; arena->freelist.next[0] = region->next[0]; - ABSL_RAW_CHECK( + Y_ABSL_RAW_CHECK( region->header.magic == Magic(kMagicUnallocated, ®ion->header), "bad magic number in DeleteArena()"); - ABSL_RAW_CHECK(region->header.arena == arena, + Y_ABSL_RAW_CHECK(region->header.arena == arena, "bad arena pointer in DeleteArena()"); - ABSL_RAW_CHECK(size % arena->pagesize == 0, + Y_ABSL_RAW_CHECK(size % arena->pagesize == 0, "empty arena has non-page-aligned block size"); - ABSL_RAW_CHECK(reinterpret_cast<uintptr_t>(region) % arena->pagesize == 0, + Y_ABSL_RAW_CHECK(reinterpret_cast<uintptr_t>(region) % arena->pagesize == 0, "empty arena has non-page-aligned block"); int munmap_result; #ifdef _WIN32 munmap_result = VirtualFree(region, 0, MEM_RELEASE); - ABSL_RAW_CHECK(munmap_result != 0, + Y_ABSL_RAW_CHECK(munmap_result != 0, "LowLevelAlloc::DeleteArena: VitualFree failed"); #else -#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#ifndef Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING if ((arena->flags & LowLevelAlloc::kAsyncSignalSafe) == 0) { munmap_result = munmap(region, size); } else { @@ -416,9 +416,9 @@ bool LowLevelAlloc::DeleteArena(Arena *arena) { } #else munmap_result = munmap(region, size); -#endif // ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#endif // Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING if (munmap_result != 0) { - ABSL_RAW_LOG(FATAL, "LowLevelAlloc::DeleteArena: munmap failed: %d", + Y_ABSL_RAW_LOG(FATAL, "LowLevelAlloc::DeleteArena: munmap failed: %d", errno); } #endif // _WIN32 @@ -435,7 +435,7 @@ bool LowLevelAlloc::DeleteArena(Arena *arena) { // manages to push through a request that would cause arithmetic to fail. static inline uintptr_t CheckedAdd(uintptr_t a, uintptr_t b) { uintptr_t sum = a + b; - ABSL_RAW_CHECK(sum >= a, "LowLevelAlloc arithmetic overflow"); + Y_ABSL_RAW_CHECK(sum >= a, "LowLevelAlloc arithmetic overflow"); return sum; } @@ -451,16 +451,16 @@ static inline uintptr_t RoundUp(uintptr_t addr, uintptr_t align) { // are adjacent in memory (they should have been coalesced). // L >= arena->mu static AllocList *Next(int i, AllocList *prev, LowLevelAlloc::Arena *arena) { - ABSL_RAW_CHECK(i < prev->levels, "too few levels in Next()"); + Y_ABSL_RAW_CHECK(i < prev->levels, "too few levels in Next()"); AllocList *next = prev->next[i]; if (next != nullptr) { - ABSL_RAW_CHECK( + Y_ABSL_RAW_CHECK( next->header.magic == Magic(kMagicUnallocated, &next->header), "bad magic number in Next()"); - ABSL_RAW_CHECK(next->header.arena == arena, "bad arena pointer in Next()"); + Y_ABSL_RAW_CHECK(next->header.arena == arena, "bad arena pointer in Next()"); if (prev != &arena->freelist) { - ABSL_RAW_CHECK(prev < next, "unordered freelist"); - ABSL_RAW_CHECK(reinterpret_cast<char *>(prev) + prev->header.size < + Y_ABSL_RAW_CHECK(prev < next, "unordered freelist"); + Y_ABSL_RAW_CHECK(reinterpret_cast<char *>(prev) + prev->header.size < reinterpret_cast<char *>(next), "malformed freelist"); } @@ -491,9 +491,9 @@ static void Coalesce(AllocList *a) { static void AddToFreelist(void *v, LowLevelAlloc::Arena *arena) { AllocList *f = reinterpret_cast<AllocList *>( reinterpret_cast<char *>(v) - sizeof (f->header)); - ABSL_RAW_CHECK(f->header.magic == Magic(kMagicAllocated, &f->header), + Y_ABSL_RAW_CHECK(f->header.magic == Magic(kMagicAllocated, &f->header), "bad magic number in AddToFreelist()"); - ABSL_RAW_CHECK(f->header.arena == arena, + Y_ABSL_RAW_CHECK(f->header.arena == arena, "bad arena pointer in AddToFreelist()"); f->levels = LLA_SkiplistLevels(f->header.size, arena->min_size, &arena->random); @@ -513,7 +513,7 @@ void LowLevelAlloc::Free(void *v) { LowLevelAlloc::Arena *arena = f->header.arena; ArenaLock section(arena); AddToFreelist(v, arena); - ABSL_RAW_CHECK(arena->allocation_count > 0, "nothing in arena to free"); + Y_ABSL_RAW_CHECK(arena->allocation_count > 0, "nothing in arena to free"); arena->allocation_count--; section.Leave(); } @@ -552,9 +552,9 @@ static void *DoAllocWithArena(size_t request, LowLevelAlloc::Arena *arena) { #ifdef _WIN32 new_pages = VirtualAlloc(0, new_pages_size, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); - ABSL_RAW_CHECK(new_pages != nullptr, "VirtualAlloc failed"); + Y_ABSL_RAW_CHECK(new_pages != nullptr, "VirtualAlloc failed"); #else -#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#ifndef Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING if ((arena->flags & LowLevelAlloc::kAsyncSignalSafe) != 0) { new_pages = base_internal::DirectMmap(nullptr, new_pages_size, PROT_WRITE|PROT_READ, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); @@ -565,9 +565,9 @@ static void *DoAllocWithArena(size_t request, LowLevelAlloc::Arena *arena) { #else new_pages = mmap(nullptr, new_pages_size, PROT_WRITE | PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); -#endif // ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#endif // Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING if (new_pages == MAP_FAILED) { - ABSL_RAW_LOG(FATAL, "mmap error: %d", errno); + Y_ABSL_RAW_LOG(FATAL, "mmap error: %d", errno); } #endif // _WIN32 @@ -593,12 +593,12 @@ static void *DoAllocWithArena(size_t request, LowLevelAlloc::Arena *arena) { AddToFreelist(&n->levels, arena); } s->header.magic = Magic(kMagicAllocated, &s->header); - ABSL_RAW_CHECK(s->header.arena == arena, ""); + Y_ABSL_RAW_CHECK(s->header.arena == arena, ""); arena->allocation_count++; section.Leave(); result = &s->levels; } - ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(result, request); + Y_ABSL_ANNOTATE_MEMORY_IS_UNINITIALIZED(result, request); return result; } @@ -608,13 +608,13 @@ void *LowLevelAlloc::Alloc(size_t request) { } void *LowLevelAlloc::AllocWithArena(size_t request, Arena *arena) { - ABSL_RAW_CHECK(arena != nullptr, "must pass a valid arena"); + Y_ABSL_RAW_CHECK(arena != nullptr, "must pass a valid arena"); void *result = DoAllocWithArena(request, arena); return result; } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_LOW_LEVEL_ALLOC_MISSING +#endif // Y_ABSL_LOW_LEVEL_ALLOC_MISSING diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.h index fa109d53ec..c70d4fd226 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_alloc.h @@ -13,8 +13,8 @@ // limitations under the License. // -#ifndef ABSL_BASE_INTERNAL_LOW_LEVEL_ALLOC_H_ -#define ABSL_BASE_INTERNAL_LOW_LEVEL_ALLOC_H_ +#ifndef Y_ABSL_BASE_INTERNAL_LOW_LEVEL_ALLOC_H_ +#define Y_ABSL_BASE_INTERNAL_LOW_LEVEL_ALLOC_H_ // A simple thread-safe memory allocator that does not depend on // mutexes or thread-specific data. It is intended to be used @@ -34,20 +34,20 @@ // LowLevelAlloc requires that the platform support low-level // allocation of virtual memory. Platforms lacking this cannot use // LowLevelAlloc. -#ifdef ABSL_LOW_LEVEL_ALLOC_MISSING -#error ABSL_LOW_LEVEL_ALLOC_MISSING cannot be directly set -#elif !defined(ABSL_HAVE_MMAP) && !defined(_WIN32) -#define ABSL_LOW_LEVEL_ALLOC_MISSING 1 +#ifdef Y_ABSL_LOW_LEVEL_ALLOC_MISSING +#error Y_ABSL_LOW_LEVEL_ALLOC_MISSING cannot be directly set +#elif !defined(Y_ABSL_HAVE_MMAP) && !defined(_WIN32) +#define Y_ABSL_LOW_LEVEL_ALLOC_MISSING 1 #endif // Using LowLevelAlloc with kAsyncSignalSafe isn't supported on Windows or // asm.js / WebAssembly. // See https://kripken.github.io/emscripten-site/docs/porting/pthreads.html // for more information. -#ifdef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING -#error ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING cannot be directly set +#ifdef Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#error Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING cannot be directly set #elif defined(_WIN32) || defined(__asmjs__) || defined(__wasm__) -#define ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING 1 +#define Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING 1 #endif #include <cstddef> @@ -55,7 +55,7 @@ #include "y_absl/base/port.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { class LowLevelAlloc { @@ -68,18 +68,18 @@ class LowLevelAlloc { // Returns 0 if passed request==0. // Does not return 0 under other circumstances; it crashes if memory // is not available. - static void *Alloc(size_t request) ABSL_ATTRIBUTE_SECTION(malloc_hook); + static void *Alloc(size_t request) Y_ABSL_ATTRIBUTE_SECTION(malloc_hook); static void *AllocWithArena(size_t request, Arena *arena) - ABSL_ATTRIBUTE_SECTION(malloc_hook); + Y_ABSL_ATTRIBUTE_SECTION(malloc_hook); // Deallocates a region of memory that was previously allocated with // Alloc(). Does nothing if passed 0. "s" must be either 0, // or must have been returned from a call to Alloc() and not yet passed to // Free() since that call to Alloc(). The space is returned to the arena // from which it was allocated. - static void Free(void *s) ABSL_ATTRIBUTE_SECTION(malloc_hook); + static void Free(void *s) Y_ABSL_ATTRIBUTE_SECTION(malloc_hook); - // ABSL_ATTRIBUTE_SECTION(malloc_hook) for Alloc* and Free + // Y_ABSL_ATTRIBUTE_SECTION(malloc_hook) for Alloc* and Free // are to put all callers of MallocHook::Invoke* in this module // into special section, // so that MallocHook::GetCallerStackTrace can function accurately. @@ -93,7 +93,7 @@ class LowLevelAlloc { // Set in the DefaultArena. kCallMallocHook = 0x0001, -#ifndef ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING +#ifndef Y_ABSL_LOW_LEVEL_ALLOC_ASYNC_SIGNAL_SAFE_MISSING // Make calls to Alloc(), Free() be async-signal-safe. Not set in // DefaultArena(). Not supported on all platforms. kAsyncSignalSafe = 0x0002, @@ -120,7 +120,7 @@ class LowLevelAlloc { }; } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_LOW_LEVEL_ALLOC_H_ +#endif // Y_ABSL_BASE_INTERNAL_LOW_LEVEL_ALLOC_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_scheduling.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_scheduling.h index 61eb4ac643..cfbe1625f4 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_scheduling.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/low_level_scheduling.h @@ -15,8 +15,8 @@ // Core interfaces and definitions used by by low-level interfaces such as // SpinLock. -#ifndef ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_ -#define ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_ +#ifndef Y_ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_ +#define Y_ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_ #include "y_absl/base/internal/raw_logging.h" #include "y_absl/base/internal/scheduling_mode.h" @@ -29,7 +29,7 @@ extern "C" bool __google_disable_rescheduling(void); extern "C" void __google_enable_rescheduling(bool disable_result); namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN class CondVar; class Mutex; @@ -124,11 +124,11 @@ inline void SchedulingGuard::EnableRescheduling(bool /* disable_result */) { inline SchedulingGuard::ScopedEnable::ScopedEnable() : scheduling_disabled_depth_(0) {} inline SchedulingGuard::ScopedEnable::~ScopedEnable() { - ABSL_RAW_CHECK(scheduling_disabled_depth_ == 0, "disable unused warning"); + Y_ABSL_RAW_CHECK(scheduling_disabled_depth_ == 0, "disable unused warning"); } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_ +#endif // Y_ABSL_BASE_INTERNAL_LOW_LEVEL_SCHEDULING_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/per_thread_tls.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/per_thread_tls.h index 943f72a433..ebc5ad4bb8 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/per_thread_tls.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/per_thread_tls.h @@ -12,41 +12,41 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_BASE_INTERNAL_PER_THREAD_TLS_H_ -#define ABSL_BASE_INTERNAL_PER_THREAD_TLS_H_ +#ifndef Y_ABSL_BASE_INTERNAL_PER_THREAD_TLS_H_ +#define Y_ABSL_BASE_INTERNAL_PER_THREAD_TLS_H_ // This header defines two macros: // // If the platform supports thread-local storage: // -// * ABSL_PER_THREAD_TLS_KEYWORD is the C keyword needed to declare a +// * Y_ABSL_PER_THREAD_TLS_KEYWORD is the C keyword needed to declare a // thread-local variable -// * ABSL_PER_THREAD_TLS is 1 +// * Y_ABSL_PER_THREAD_TLS is 1 // // Otherwise: // -// * ABSL_PER_THREAD_TLS_KEYWORD is empty -// * ABSL_PER_THREAD_TLS is 0 +// * Y_ABSL_PER_THREAD_TLS_KEYWORD is empty +// * Y_ABSL_PER_THREAD_TLS is 0 // // Microsoft C supports thread-local storage. // GCC supports it if the appropriate version of glibc is available, -// which the programmer can indicate by defining ABSL_HAVE_TLS +// which the programmer can indicate by defining Y_ABSL_HAVE_TLS -#include "y_absl/base/port.h" // For ABSL_HAVE_TLS +#include "y_absl/base/port.h" // For Y_ABSL_HAVE_TLS -#if defined(ABSL_PER_THREAD_TLS) -#error ABSL_PER_THREAD_TLS cannot be directly set -#elif defined(ABSL_PER_THREAD_TLS_KEYWORD) -#error ABSL_PER_THREAD_TLS_KEYWORD cannot be directly set -#elif defined(ABSL_HAVE_TLS) -#define ABSL_PER_THREAD_TLS_KEYWORD __thread -#define ABSL_PER_THREAD_TLS 1 +#if defined(Y_ABSL_PER_THREAD_TLS) +#error Y_ABSL_PER_THREAD_TLS cannot be directly set +#elif defined(Y_ABSL_PER_THREAD_TLS_KEYWORD) +#error Y_ABSL_PER_THREAD_TLS_KEYWORD cannot be directly set +#elif defined(Y_ABSL_HAVE_TLS) +#define Y_ABSL_PER_THREAD_TLS_KEYWORD __thread +#define Y_ABSL_PER_THREAD_TLS 1 #elif defined(_MSC_VER) -#define ABSL_PER_THREAD_TLS_KEYWORD __declspec(thread) -#define ABSL_PER_THREAD_TLS 1 +#define Y_ABSL_PER_THREAD_TLS_KEYWORD __declspec(thread) +#define Y_ABSL_PER_THREAD_TLS 1 #else -#define ABSL_PER_THREAD_TLS_KEYWORD -#define ABSL_PER_THREAD_TLS 0 +#define Y_ABSL_PER_THREAD_TLS_KEYWORD +#define Y_ABSL_PER_THREAD_TLS 0 #endif -#endif // ABSL_BASE_INTERNAL_PER_THREAD_TLS_H_ +#endif // Y_ABSL_BASE_INTERNAL_PER_THREAD_TLS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/pretty_function.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/pretty_function.h index 35d51676dc..552b379dbf 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/pretty_function.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/pretty_function.h @@ -12,22 +12,22 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_BASE_INTERNAL_PRETTY_FUNCTION_H_ -#define ABSL_BASE_INTERNAL_PRETTY_FUNCTION_H_ +#ifndef Y_ABSL_BASE_INTERNAL_PRETTY_FUNCTION_H_ +#define Y_ABSL_BASE_INTERNAL_PRETTY_FUNCTION_H_ -// ABSL_PRETTY_FUNCTION +// Y_ABSL_PRETTY_FUNCTION // // In C++11, __func__ gives the undecorated name of the current function. That // is, "main", not "int main()". Various compilers give extra macros to get the // decorated function name, including return type and arguments, to -// differentiate between overload sets. ABSL_PRETTY_FUNCTION is a portable +// differentiate between overload sets. Y_ABSL_PRETTY_FUNCTION is a portable // version of these macros which forwards to the correct macro on each compiler. #if defined(_MSC_VER) -#define ABSL_PRETTY_FUNCTION __FUNCSIG__ +#define Y_ABSL_PRETTY_FUNCTION __FUNCSIG__ #elif defined(__GNUC__) -#define ABSL_PRETTY_FUNCTION __PRETTY_FUNCTION__ +#define Y_ABSL_PRETTY_FUNCTION __PRETTY_FUNCTION__ #else #error "Unsupported compiler" #endif -#endif // ABSL_BASE_INTERNAL_PRETTY_FUNCTION_H_ +#endif // Y_ABSL_BASE_INTERNAL_PRETTY_FUNCTION_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.cc index ea9a48c2c0..75af4543d5 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.cc @@ -26,11 +26,11 @@ #include "y_absl/base/log_severity.h" // We know how to perform low-level writes to stderr in POSIX and Windows. For -// these platforms, we define the token ABSL_LOW_LEVEL_WRITE_SUPPORTED. +// these platforms, we define the token Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED. // Much of raw_logging.cc becomes a no-op when we can't output messages, -// although a FATAL ABSL_RAW_LOG message will still abort the process. +// although a FATAL Y_ABSL_RAW_LOG message will still abort the process. -// ABSL_HAVE_POSIX_WRITE is defined when the platform provides posix write() +// Y_ABSL_HAVE_POSIX_WRITE is defined when the platform provides posix write() // (as from unistd.h) // // This preprocessor token is also defined in raw_io.cc. If you need to copy @@ -41,49 +41,49 @@ #include <unistd.h> -#define ABSL_HAVE_POSIX_WRITE 1 -#define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 +#define Y_ABSL_HAVE_POSIX_WRITE 1 +#define Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 #else -#undef ABSL_HAVE_POSIX_WRITE +#undef Y_ABSL_HAVE_POSIX_WRITE #endif -// ABSL_HAVE_SYSCALL_WRITE is defined when the platform provides the syscall +// Y_ABSL_HAVE_SYSCALL_WRITE is defined when the platform provides the syscall // syscall(SYS_write, /*int*/ fd, /*char* */ buf, /*size_t*/ len); // for low level operations that want to avoid libc. #if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__) #include <sys/syscall.h> -#define ABSL_HAVE_SYSCALL_WRITE 1 -#define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 +#define Y_ABSL_HAVE_SYSCALL_WRITE 1 +#define Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 #else -#undef ABSL_HAVE_SYSCALL_WRITE +#undef Y_ABSL_HAVE_SYSCALL_WRITE #endif #ifdef _WIN32 #include <io.h> -#define ABSL_HAVE_RAW_IO 1 -#define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 +#define Y_ABSL_HAVE_RAW_IO 1 +#define Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 #else -#undef ABSL_HAVE_RAW_IO +#undef Y_ABSL_HAVE_RAW_IO #endif namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace raw_logging_internal { namespace { // TODO(gfalcon): We want raw-logging to work on as many platforms as possible. -// Explicitly `#error` out when not `ABSL_LOW_LEVEL_WRITE_SUPPORTED`, except for +// Explicitly `#error` out when not `Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED`, except for // a selected set of platforms for which we expect not to be able to raw log. -ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES +Y_ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES y_absl::base_internal::AtomicHook<LogPrefixHook> log_prefix_hook; -ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES +Y_ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES y_absl::base_internal::AtomicHook<AbortHook> abort_hook; -#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED +#ifdef Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED constexpr char kTruncated[] = " ... (message truncated)\n"; // sprintf the format to the buffer, adjusting *buf and *size to reflect the @@ -91,7 +91,7 @@ constexpr char kTruncated[] = " ... (message truncated)\n"; // truncation occurred, if possible leave room in the buffer for the message // kTruncated[]. bool VADoRawLog(char** buf, int* size, const char* format, va_list ap) - ABSL_PRINTF_ATTRIBUTE(3, 0); + Y_ABSL_PRINTF_ATTRIBUTE(3, 0); bool VADoRawLog(char** buf, int* size, const char* format, va_list ap) { int n = vsnprintf(*buf, *size, format, ap); bool result = true; @@ -107,7 +107,7 @@ bool VADoRawLog(char** buf, int* size, const char* format, va_list ap) { *buf += n; return result; } -#endif // ABSL_LOW_LEVEL_WRITE_SUPPORTED +#endif // Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED constexpr int kLogBufSize = 3000; @@ -118,7 +118,7 @@ constexpr int kLogBufSize = 3000; // *DoRawLog writes to *buf of *size and move them past the written portion. // It returns true iff there was no overflow or error. bool DoRawLog(char** buf, int* size, const char* format, ...) - ABSL_PRINTF_ATTRIBUTE(3, 4); + Y_ABSL_PRINTF_ATTRIBUTE(3, 4); bool DoRawLog(char** buf, int* size, const char* format, ...) { va_list ap; va_start(ap, format); @@ -131,20 +131,20 @@ bool DoRawLog(char** buf, int* size, const char* format, ...) { } void RawLogVA(y_absl::LogSeverity severity, const char* file, int line, - const char* format, va_list ap) ABSL_PRINTF_ATTRIBUTE(4, 0); + const char* format, va_list ap) Y_ABSL_PRINTF_ATTRIBUTE(4, 0); void RawLogVA(y_absl::LogSeverity severity, const char* file, int line, const char* format, va_list ap) { char buffer[kLogBufSize]; char* buf = buffer; int size = sizeof(buffer); -#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED +#ifdef Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED bool enabled = true; #else bool enabled = false; #endif -#ifdef ABSL_MIN_LOG_LEVEL - if (severity < static_cast<y_absl::LogSeverity>(ABSL_MIN_LOG_LEVEL) && +#ifdef Y_ABSL_MIN_LOG_LEVEL + if (severity < static_cast<y_absl::LogSeverity>(Y_ABSL_MIN_LOG_LEVEL) && severity < y_absl::LogSeverity::kFatal) { enabled = false; } @@ -160,7 +160,7 @@ void RawLogVA(y_absl::LogSeverity severity, const char* file, int line, } const char* const prefix_end = buf; -#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED +#ifdef Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED if (enabled) { bool no_chop = VADoRawLog(&buf, &size, format, ap); if (no_chop) { @@ -196,11 +196,11 @@ void DefaultInternalLog(y_absl::LogSeverity severity, const char* file, int line } // namespace void SafeWriteToStderr(const char *s, size_t len) { -#if defined(ABSL_HAVE_SYSCALL_WRITE) +#if defined(Y_ABSL_HAVE_SYSCALL_WRITE) syscall(SYS_write, STDERR_FILENO, s, len); -#elif defined(ABSL_HAVE_POSIX_WRITE) +#elif defined(Y_ABSL_HAVE_POSIX_WRITE) write(STDERR_FILENO, s, len); -#elif defined(ABSL_HAVE_RAW_IO) +#elif defined(Y_ABSL_HAVE_RAW_IO) _write(/* stderr */ 2, s, len); #else // stderr logging unsupported on this platform @@ -218,14 +218,14 @@ void RawLog(y_absl::LogSeverity severity, const char* file, int line, } bool RawLoggingFullySupported() { -#ifdef ABSL_LOW_LEVEL_WRITE_SUPPORTED +#ifdef Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED return true; -#else // !ABSL_LOW_LEVEL_WRITE_SUPPORTED +#else // !Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED return false; -#endif // !ABSL_LOW_LEVEL_WRITE_SUPPORTED +#endif // !Y_ABSL_LOW_LEVEL_WRITE_SUPPORTED } -ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES ABSL_DLL +Y_ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES Y_ABSL_DLL y_absl::base_internal::AtomicHook<InternalLogFunction> internal_log_function(DefaultInternalLog); @@ -238,5 +238,5 @@ void RegisterInternalLogFunction(InternalLogFunction func) { } } // namespace raw_logging_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.h index 4d5c77003f..8febc13fc3 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/raw_logging.h @@ -16,8 +16,8 @@ // acquire any locks, and can therefore be used by low-level memory // allocation, synchronization, and signal-handling code. -#ifndef ABSL_BASE_INTERNAL_RAW_LOGGING_H_ -#define ABSL_BASE_INTERNAL_RAW_LOGGING_H_ +#ifndef Y_ABSL_BASE_INTERNAL_RAW_LOGGING_H_ +#define Y_ABSL_BASE_INTERNAL_RAW_LOGGING_H_ #include <util/generic/string.h> @@ -37,33 +37,33 @@ // * it uses an explicit printf-format and arguments list // * it will silently chop off really long message strings // Usage example: -// ABSL_RAW_LOG(ERROR, "Failed foo with %i: %s", status, error); +// Y_ABSL_RAW_LOG(ERROR, "Failed foo with %i: %s", status, error); // This will print an almost standard log line like this to stderr only: // E0821 211317 file.cc:123] RAW: Failed foo with 22: bad_file -#define ABSL_RAW_LOG(severity, ...) \ +#define Y_ABSL_RAW_LOG(severity, ...) \ do { \ constexpr const char* absl_raw_logging_internal_basename = \ ::y_absl::raw_logging_internal::Basename(__FILE__, \ sizeof(__FILE__) - 1); \ - ::y_absl::raw_logging_internal::RawLog(ABSL_RAW_LOGGING_INTERNAL_##severity, \ + ::y_absl::raw_logging_internal::RawLog(Y_ABSL_RAW_LOGGING_INTERNAL_##severity, \ absl_raw_logging_internal_basename, \ __LINE__, __VA_ARGS__); \ } while (0) // Similar to CHECK(condition) << message, but for low-level modules: -// we use only ABSL_RAW_LOG that does not allocate memory. +// we use only Y_ABSL_RAW_LOG that does not allocate memory. // We do not want to provide args list here to encourage this usage: -// if (!cond) ABSL_RAW_LOG(FATAL, "foo ...", hard_to_compute_args); +// if (!cond) Y_ABSL_RAW_LOG(FATAL, "foo ...", hard_to_compute_args); // so that the args are not computed when not needed. -#define ABSL_RAW_CHECK(condition, message) \ +#define Y_ABSL_RAW_CHECK(condition, message) \ do { \ - if (ABSL_PREDICT_FALSE(!(condition))) { \ - ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \ + if (Y_ABSL_PREDICT_FALSE(!(condition))) { \ + Y_ABSL_RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \ } \ } while (0) -// ABSL_INTERNAL_LOG and ABSL_INTERNAL_CHECK work like the RAW variants above, +// Y_ABSL_INTERNAL_LOG and Y_ABSL_INTERNAL_CHECK work like the RAW variants above, // except that if the richer log library is linked into the binary, we dispatch // to that instead. This is potentially useful for internal logging and // assertions, where we are using RAW_LOG neither for its async-signal-safety @@ -72,42 +72,42 @@ // // The API is a subset of the above: each macro only takes two arguments. Use // StrCat if you need to build a richer message. -#define ABSL_INTERNAL_LOG(severity, message) \ +#define Y_ABSL_INTERNAL_LOG(severity, message) \ do { \ constexpr const char* absl_raw_logging_internal_filename = __FILE__; \ ::y_absl::raw_logging_internal::internal_log_function( \ - ABSL_RAW_LOGGING_INTERNAL_##severity, \ + Y_ABSL_RAW_LOGGING_INTERNAL_##severity, \ absl_raw_logging_internal_filename, __LINE__, message); \ - if (ABSL_RAW_LOGGING_INTERNAL_##severity == ::y_absl::LogSeverity::kFatal) \ - ABSL_INTERNAL_UNREACHABLE; \ + if (Y_ABSL_RAW_LOGGING_INTERNAL_##severity == ::y_absl::LogSeverity::kFatal) \ + Y_ABSL_INTERNAL_UNREACHABLE; \ } while (0) -#define ABSL_INTERNAL_CHECK(condition, message) \ +#define Y_ABSL_INTERNAL_CHECK(condition, message) \ do { \ - if (ABSL_PREDICT_FALSE(!(condition))) { \ + if (Y_ABSL_PREDICT_FALSE(!(condition))) { \ TString death_message = "Check " #condition " failed: "; \ death_message += TString(message); \ - ABSL_INTERNAL_LOG(FATAL, death_message); \ + Y_ABSL_INTERNAL_LOG(FATAL, death_message); \ } \ } while (0) -#define ABSL_RAW_LOGGING_INTERNAL_INFO ::y_absl::LogSeverity::kInfo -#define ABSL_RAW_LOGGING_INTERNAL_WARNING ::y_absl::LogSeverity::kWarning -#define ABSL_RAW_LOGGING_INTERNAL_ERROR ::y_absl::LogSeverity::kError -#define ABSL_RAW_LOGGING_INTERNAL_FATAL ::y_absl::LogSeverity::kFatal -#define ABSL_RAW_LOGGING_INTERNAL_LEVEL(severity) \ +#define Y_ABSL_RAW_LOGGING_INTERNAL_INFO ::y_absl::LogSeverity::kInfo +#define Y_ABSL_RAW_LOGGING_INTERNAL_WARNING ::y_absl::LogSeverity::kWarning +#define Y_ABSL_RAW_LOGGING_INTERNAL_ERROR ::y_absl::LogSeverity::kError +#define Y_ABSL_RAW_LOGGING_INTERNAL_FATAL ::y_absl::LogSeverity::kFatal +#define Y_ABSL_RAW_LOGGING_INTERNAL_LEVEL(severity) \ ::y_absl::NormalizeLogSeverity(severity) namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace raw_logging_internal { -// Helper function to implement ABSL_RAW_LOG +// Helper function to implement Y_ABSL_RAW_LOG // Logs format... at "severity" level, reporting it // as called from file:line. // This does not allocate memory or acquire locks. void RawLog(y_absl::LogSeverity severity, const char* file, int line, - const char* format, ...) ABSL_PRINTF_ATTRIBUTE(4, 5); + const char* format, ...) Y_ABSL_PRINTF_ATTRIBUTE(4, 5); // Writes the provided buffer directly to stderr, in a safe, low-level manner. // @@ -146,7 +146,7 @@ bool RawLoggingFullySupported(); // hooks must avoid these operations, and must not throw exceptions. // // 'severity' is the severity level of the message being written. -// 'file' and 'line' are the file and line number where the ABSL_RAW_LOG macro +// 'file' and 'line' are the file and line number where the Y_ABSL_RAW_LOG macro // was located. // 'buffer' and 'buf_size' are pointers to the buffer and buffer size. If the // hook writes a prefix, it must increment *buffer and decrement *buf_size @@ -158,7 +158,7 @@ using LogPrefixHook = bool (*)(y_absl::LogSeverity severity, const char* file, // when a FATAL message is logged. If the provided AbortHook() returns, the // logging system will call abort(). // -// 'file' and 'line' are the file and line number where the ABSL_RAW_LOG macro +// 'file' and 'line' are the file and line number where the Y_ABSL_RAW_LOG macro // was located. // The NUL-terminated logged message lives in the buffer between 'buf_start' // and 'buf_end'. 'prefix_end' points to the first non-prefix character of the @@ -166,7 +166,7 @@ using LogPrefixHook = bool (*)(y_absl::LogSeverity severity, const char* file, using AbortHook = void (*)(const char* file, int line, const char* buf_start, const char* prefix_end, const char* buf_end); -// Internal logging function for ABSL_INTERNAL_LOG to dispatch to. +// Internal logging function for Y_ABSL_INTERNAL_LOG to dispatch to. // // TODO(gfalcon): When string_view no longer depends on base, change this // interface to take its message as a string_view instead. @@ -174,7 +174,7 @@ using InternalLogFunction = void (*)(y_absl::LogSeverity severity, const char* file, int line, const TString& message); -ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES ABSL_DLL extern base_internal::AtomicHook< +Y_ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES Y_ABSL_DLL extern base_internal::AtomicHook< InternalLogFunction> internal_log_function; @@ -189,7 +189,7 @@ void RegisterAbortHook(AbortHook func); void RegisterInternalLogFunction(InternalLogFunction func); } // namespace raw_logging_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_RAW_LOGGING_H_ +#endif // Y_ABSL_BASE_INTERNAL_RAW_LOGGING_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scheduling_mode.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scheduling_mode.h index 0165e7233b..5a52ccf6fe 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scheduling_mode.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scheduling_mode.h @@ -15,13 +15,13 @@ // Core interfaces and definitions used by by low-level interfaces such as // SpinLock. -#ifndef ABSL_BASE_INTERNAL_SCHEDULING_MODE_H_ -#define ABSL_BASE_INTERNAL_SCHEDULING_MODE_H_ +#ifndef Y_ABSL_BASE_INTERNAL_SCHEDULING_MODE_H_ +#define Y_ABSL_BASE_INTERNAL_SCHEDULING_MODE_H_ #include "y_absl/base/config.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // Used to describe how a thread may be scheduled. Typically associated with @@ -52,7 +52,7 @@ enum SchedulingMode { }; } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_SCHEDULING_MODE_H_ +#endif // Y_ABSL_BASE_INTERNAL_SCHEDULING_MODE_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.cc index e489272b45..ad48ddbcee 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.cc @@ -23,7 +23,7 @@ #include "y_absl/base/internal/raw_logging.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { namespace { @@ -51,7 +51,7 @@ ScopedSetEnv::ScopedSetEnv(const char* var_name, const char* new_value) #ifdef _WIN32 char buf[kMaxEnvVarValueSize]; auto get_res = GetEnvironmentVariableA(var_name_.c_str(), buf, sizeof(buf)); - ABSL_INTERNAL_CHECK(get_res < sizeof(buf), "value exceeds buffer size"); + Y_ABSL_INTERNAL_CHECK(get_res < sizeof(buf), "value exceeds buffer size"); if (get_res == 0) { was_unset_ = (GetLastError() == ERROR_ENVVAR_NOT_FOUND); @@ -77,5 +77,5 @@ ScopedSetEnv::~ScopedSetEnv() { } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.h index 5641562f1b..f414235b28 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/scoped_set_env.h @@ -14,15 +14,15 @@ // limitations under the License. // -#ifndef ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ -#define ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ +#ifndef Y_ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ +#define Y_ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ #include <util/generic/string.h> #include "y_absl/base/config.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { class ScopedSetEnv { @@ -39,7 +39,7 @@ class ScopedSetEnv { }; } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ +#endif // Y_ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.cc index 2ee7cde432..efffecdb7e 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.cc @@ -54,10 +54,10 @@ // holder to acquire the lock. There may be outstanding waiter(s). namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { -ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES static base_internal::AtomicHook<void (*)( +Y_ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES static base_internal::AtomicHook<void (*)( const void *lock, int64_t wait_cycles)> submit_profile_data; @@ -76,7 +76,7 @@ constexpr uint32_t SpinLock::kWaitTimeMask; // Uncommon constructors. SpinLock::SpinLock(base_internal::SchedulingMode mode) : lockword_(IsCooperative(mode) ? kSpinLockCooperative : 0) { - ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static); + Y_ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static); } // Monitor the lock to see if its value changes within some time period @@ -85,8 +85,8 @@ SpinLock::SpinLock(base_internal::SchedulingMode mode) uint32_t SpinLock::SpinLoop() { // We are already in the slow path of SpinLock, initialize the // adaptive_spin_count here. - ABSL_CONST_INIT static y_absl::once_flag init_adaptive_spin_count; - ABSL_CONST_INIT static int adaptive_spin_count = 0; + Y_ABSL_CONST_INIT static y_absl::once_flag init_adaptive_spin_count; + Y_ABSL_CONST_INIT static int adaptive_spin_count = 0; base_internal::LowLevelCallOnce(&init_adaptive_spin_count, []() { adaptive_spin_count = base_internal::NumCPUs() > 1 ? 1000 : 1; }); @@ -154,11 +154,11 @@ void SpinLock::SlowLock() { // SpinLockDelay() calls into fiber scheduler, we need to see // synchronization there to avoid false positives. - ABSL_TSAN_MUTEX_PRE_DIVERT(this, 0); + Y_ABSL_TSAN_MUTEX_PRE_DIVERT(this, 0); // Wait for an OS specific delay. base_internal::SpinLockDelay(&lockword_, lock_value, ++lock_wait_call_count, scheduling_mode); - ABSL_TSAN_MUTEX_POST_DIVERT(this, 0); + Y_ABSL_TSAN_MUTEX_POST_DIVERT(this, 0); // Spin again after returning from the wait routine to give this thread // some chance of obtaining the lock. lock_value = SpinLoop(); @@ -176,9 +176,9 @@ void SpinLock::SlowUnlock(uint32_t lock_value) { // own acquisition having been contended. if ((lock_value & kWaitTimeMask) != kSpinLockSleeper) { const uint64_t wait_cycles = DecodeWaitCycles(lock_value); - ABSL_TSAN_MUTEX_PRE_DIVERT(this, 0); + Y_ABSL_TSAN_MUTEX_PRE_DIVERT(this, 0); submit_profile_data(this, wait_cycles); - ABSL_TSAN_MUTEX_POST_DIVERT(this, 0); + Y_ABSL_TSAN_MUTEX_POST_DIVERT(this, 0); } } @@ -225,5 +225,5 @@ uint64_t SpinLock::DecodeWaitCycles(uint32_t lock_value) { } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.h index ef88cb52c0..a570699d68 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock.h @@ -26,8 +26,8 @@ // // Threads waiting on a SpinLock may be woken in an arbitrary order. -#ifndef ABSL_BASE_INTERNAL_SPINLOCK_H_ -#define ABSL_BASE_INTERNAL_SPINLOCK_H_ +#ifndef Y_ABSL_BASE_INTERNAL_SPINLOCK_H_ +#define Y_ABSL_BASE_INTERNAL_SPINLOCK_H_ #include <stdint.h> #include <sys/types.h> @@ -46,13 +46,13 @@ #include "y_absl/base/thread_annotations.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { -class ABSL_LOCKABLE SpinLock { +class Y_ABSL_LOCKABLE SpinLock { public: SpinLock() : lockword_(kSpinLockCooperative) { - ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static); + Y_ABSL_TSAN_MUTEX_CREATE(this, __tsan_mutex_not_static); } // Constructors that allow non-cooperative spinlocks to be created for use @@ -66,37 +66,37 @@ class ABSL_LOCKABLE SpinLock { // For global SpinLock instances prefer trivial destructor when possible. // Default but non-trivial destructor in some build configurations causes an // extra static initializer. -#ifdef ABSL_INTERNAL_HAVE_TSAN_INTERFACE - ~SpinLock() { ABSL_TSAN_MUTEX_DESTROY(this, __tsan_mutex_not_static); } +#ifdef Y_ABSL_INTERNAL_HAVE_TSAN_INTERFACE + ~SpinLock() { Y_ABSL_TSAN_MUTEX_DESTROY(this, __tsan_mutex_not_static); } #else ~SpinLock() = default; #endif // Acquire this SpinLock. - inline void Lock() ABSL_EXCLUSIVE_LOCK_FUNCTION() { - ABSL_TSAN_MUTEX_PRE_LOCK(this, 0); + inline void Lock() Y_ABSL_EXCLUSIVE_LOCK_FUNCTION() { + Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, 0); if (!TryLockImpl()) { SlowLock(); } - ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0); + Y_ABSL_TSAN_MUTEX_POST_LOCK(this, 0, 0); } // Try to acquire this SpinLock without blocking and return true if the // acquisition was successful. If the lock was not acquired, false is // returned. If this SpinLock is free at the time of the call, TryLock // will return true with high probability. - inline bool TryLock() ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) { - ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_try_lock); + inline bool TryLock() Y_ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(true) { + Y_ABSL_TSAN_MUTEX_PRE_LOCK(this, __tsan_mutex_try_lock); bool res = TryLockImpl(); - ABSL_TSAN_MUTEX_POST_LOCK( + Y_ABSL_TSAN_MUTEX_POST_LOCK( this, __tsan_mutex_try_lock | (res ? 0 : __tsan_mutex_try_lock_failed), 0); return res; } // Release this SpinLock, which must be held by the calling thread. - inline void Unlock() ABSL_UNLOCK_FUNCTION() { - ABSL_TSAN_MUTEX_PRE_UNLOCK(this, 0); + inline void Unlock() Y_ABSL_UNLOCK_FUNCTION() { + Y_ABSL_TSAN_MUTEX_PRE_UNLOCK(this, 0); uint32_t lock_value = lockword_.load(std::memory_order_relaxed); lock_value = lockword_.exchange(lock_value & kSpinLockCooperative, std::memory_order_release); @@ -110,7 +110,7 @@ class ABSL_LOCKABLE SpinLock { // for the lock. SlowUnlock(lock_value); } - ABSL_TSAN_MUTEX_POST_UNLOCK(this, 0); + Y_ABSL_TSAN_MUTEX_POST_UNLOCK(this, 0); } // Determine if the lock is held. When the lock is held by the invoking @@ -168,8 +168,8 @@ class ABSL_LOCKABLE SpinLock { } uint32_t TryLockInternal(uint32_t lock_value, uint32_t wait_cycles); - void SlowLock() ABSL_ATTRIBUTE_COLD; - void SlowUnlock(uint32_t lock_value) ABSL_ATTRIBUTE_COLD; + void SlowLock() Y_ABSL_ATTRIBUTE_COLD; + void SlowUnlock(uint32_t lock_value) Y_ABSL_ATTRIBUTE_COLD; uint32_t SpinLoop(); inline bool TryLockImpl() { @@ -185,13 +185,13 @@ class ABSL_LOCKABLE SpinLock { // Corresponding locker object that arranges to acquire a spinlock for // the duration of a C++ scope. -class ABSL_SCOPED_LOCKABLE SpinLockHolder { +class Y_ABSL_SCOPED_LOCKABLE SpinLockHolder { public: - inline explicit SpinLockHolder(SpinLock* l) ABSL_EXCLUSIVE_LOCK_FUNCTION(l) + inline explicit SpinLockHolder(SpinLock* l) Y_ABSL_EXCLUSIVE_LOCK_FUNCTION(l) : lock_(l) { l->Lock(); } - inline ~SpinLockHolder() ABSL_UNLOCK_FUNCTION() { lock_->Unlock(); } + inline ~SpinLockHolder() Y_ABSL_UNLOCK_FUNCTION() { lock_->Unlock(); } SpinLockHolder(const SpinLockHolder&) = delete; SpinLockHolder& operator=(const SpinLockHolder&) = delete; @@ -242,7 +242,7 @@ inline uint32_t SpinLock::TryLockInternal(uint32_t lock_value, } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_SPINLOCK_H_ +#endif // Y_ABSL_BASE_INTERNAL_SPINLOCK_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_akaros.inc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_akaros.inc index 69955dc765..f6687cc3b6 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_akaros.inc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_akaros.inc @@ -20,7 +20,7 @@ extern "C" { -ABSL_ATTRIBUTE_WEAK void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( +Y_ABSL_ATTRIBUTE_WEAK void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( std::atomic<uint32_t>* /* lock_word */, uint32_t /* value */, int /* loop */, y_absl::base_internal::SchedulingMode /* mode */) { // In Akaros, one must take care not to call anything that could cause a @@ -29,7 +29,7 @@ ABSL_ATTRIBUTE_WEAK void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( // arbitrary code. } -ABSL_ATTRIBUTE_WEAK void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)( +Y_ABSL_ATTRIBUTE_WEAK void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)( std::atomic<uint32_t>* /* lock_word */, bool /* all */) {} } // extern "C" diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_linux.inc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_linux.inc index 5b4480d133..5d2bbbcd15 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_linux.inc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_linux.inc @@ -56,7 +56,7 @@ static_assert(sizeof(std::atomic<uint32_t>) == sizeof(int), extern "C" { -ABSL_ATTRIBUTE_WEAK void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( +Y_ABSL_ATTRIBUTE_WEAK void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( std::atomic<uint32_t> *w, uint32_t value, int loop, y_absl::base_internal::SchedulingMode) { y_absl::base_internal::ErrnoSaver errno_saver; @@ -66,7 +66,7 @@ ABSL_ATTRIBUTE_WEAK void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( syscall(SYS_futex, w, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, value, &tm); } -ABSL_ATTRIBUTE_WEAK void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)( +Y_ABSL_ATTRIBUTE_WEAK void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)( std::atomic<uint32_t> *w, bool all) { syscall(SYS_futex, w, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, all ? INT_MAX : 1, 0); } diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_posix.inc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_posix.inc index 12a9b86599..c629c981fe 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_posix.inc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_posix.inc @@ -25,7 +25,7 @@ extern "C" { -ABSL_ATTRIBUTE_WEAK void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( +Y_ABSL_ATTRIBUTE_WEAK void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( std::atomic<uint32_t>* /* lock_word */, uint32_t /* value */, int loop, y_absl::base_internal::SchedulingMode /* mode */) { y_absl::base_internal::ErrnoSaver errno_saver; @@ -40,7 +40,7 @@ ABSL_ATTRIBUTE_WEAK void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( } } -ABSL_ATTRIBUTE_WEAK void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)( +Y_ABSL_ATTRIBUTE_WEAK void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)( std::atomic<uint32_t>* /* lock_word */, bool /* all */) {} } // extern "C" diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait.cc index 138cb3c5f0..81dcd0757e 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait.cc @@ -32,7 +32,7 @@ #endif namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // See spinlock_wait.h for spec. @@ -77,5 +77,5 @@ int SpinLockSuggestedDelayNS(int loop) { } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait.h index 2e34d7026b..0fd08f5260 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_wait.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_BASE_INTERNAL_SPINLOCK_WAIT_H_ -#define ABSL_BASE_INTERNAL_SPINLOCK_WAIT_H_ +#ifndef Y_ABSL_BASE_INTERNAL_SPINLOCK_WAIT_H_ +#define Y_ABSL_BASE_INTERNAL_SPINLOCK_WAIT_H_ // Operations to make atomic transitions on a word, and to allow // waiting for those transitions to become possible. @@ -24,7 +24,7 @@ #include "y_absl/base/internal/scheduling_mode.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // SpinLockWait() waits until it can perform one of several transitions from @@ -63,7 +63,7 @@ void SpinLockDelay(std::atomic<uint32_t> *w, uint32_t value, int loop, int SpinLockSuggestedDelayNS(int loop); } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl // In some build configurations we pass --detect-odr-violations to the @@ -73,23 +73,23 @@ ABSL_NAMESPACE_END // By changing our extension points to be extern "C", we dodge this // check. extern "C" { -void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)(std::atomic<uint32_t> *w, +void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)(std::atomic<uint32_t> *w, bool all); -void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( +void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( std::atomic<uint32_t> *w, uint32_t value, int loop, y_absl::base_internal::SchedulingMode scheduling_mode); } inline void y_absl::base_internal::SpinLockWake(std::atomic<uint32_t> *w, bool all) { - ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)(w, all); + Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)(w, all); } inline void y_absl::base_internal::SpinLockDelay( std::atomic<uint32_t> *w, uint32_t value, int loop, y_absl::base_internal::SchedulingMode scheduling_mode) { - ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay) + Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay) (w, value, loop, scheduling_mode); } -#endif // ABSL_BASE_INTERNAL_SPINLOCK_WAIT_H_ +#endif // Y_ABSL_BASE_INTERNAL_SPINLOCK_WAIT_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_win32.inc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_win32.inc index 648f74134f..c80dfdf05c 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_win32.inc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/spinlock_win32.inc @@ -20,7 +20,7 @@ extern "C" { -void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( +void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( std::atomic<uint32_t>* /* lock_word */, uint32_t /* value */, int loop, y_absl::base_internal::SchedulingMode /* mode */) { if (loop == 0) { @@ -31,7 +31,7 @@ void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockDelay)( } } -void ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)( +void Y_ABSL_INTERNAL_C_SYMBOL(AbslInternalSpinLockWake)( std::atomic<uint32_t>* /* lock_word */, bool /* all */) {} } // extern "C" diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.cc index fe50d84a03..ae1e09f791 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.cc @@ -25,7 +25,7 @@ #include "y_absl/base/internal/errno_saver.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { namespace { @@ -84,5 +84,5 @@ TString StrError(int errnum) { } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.h index a80a7b9c35..941c030616 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/strerror.h @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_BASE_INTERNAL_STRERROR_H_ -#define ABSL_BASE_INTERNAL_STRERROR_H_ +#ifndef Y_ABSL_BASE_INTERNAL_STRERROR_H_ +#define Y_ABSL_BASE_INTERNAL_STRERROR_H_ #include <util/generic/string.h> #include "y_absl/base/config.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // A portable and thread-safe alternative to C89's `strerror`. @@ -33,7 +33,7 @@ namespace base_internal { TString StrError(int errnum); } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_STRERROR_H_ +#endif // Y_ABSL_BASE_INTERNAL_STRERROR_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/sysinfo.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/sysinfo.cc index 9eb0cf3f8c..6a1ef60711 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/sysinfo.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/sysinfo.cc @@ -58,7 +58,7 @@ #include "y_absl/base/thread_annotations.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { namespace { @@ -210,7 +210,7 @@ static bool ReadLongFromFile(const char *file, long *value) { return ret; } -#if defined(ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY) +#if defined(Y_ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY) // Reads a monotonic time source and returns a value in // nanoseconds. The returned value uses an arbitrary epoch, not the @@ -295,7 +295,7 @@ static double MeasureTscFrequency() { return last_measurement; } -#endif // ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY +#endif // Y_ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY static double GetNominalCPUFrequency() { long freq = 0; @@ -312,7 +312,7 @@ static double GetNominalCPUFrequency() { return freq * 1e3; // Value is kHz. } -#if defined(ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY) +#if defined(Y_ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY) // On these platforms, the TSC frequency is the nominal CPU // frequency. But without having the kernel export it directly // though /sys/devices/system/cpu/cpu0/tsc_freq_khz, there is no @@ -335,13 +335,13 @@ static double GetNominalCPUFrequency() { } return 1.0; -#endif // !ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY +#endif // !Y_ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY } #endif -ABSL_CONST_INIT static once_flag init_num_cpus_once; -ABSL_CONST_INIT static int num_cpus = 0; +Y_ABSL_CONST_INIT static once_flag init_num_cpus_once; +Y_ABSL_CONST_INIT static int num_cpus = 0; // NumCPUs() may be called before main() and before malloc is properly // initialized, therefore this must not allocate memory. @@ -352,8 +352,8 @@ int NumCPUs() { } // A default frequency of 0.0 might be dangerous if it is used in division. -ABSL_CONST_INIT static once_flag init_nominal_cpu_frequency_once; -ABSL_CONST_INIT static double nominal_cpu_frequency = 1.0; +Y_ABSL_CONST_INIT static once_flag init_nominal_cpu_frequency_once; +Y_ABSL_CONST_INIT static double nominal_cpu_frequency = 1.0; // NominalCPUFrequency() may be called before main() and before malloc is // properly initialized, therefore this must not allocate memory. @@ -415,16 +415,16 @@ pid_t GetTID() { #else // Fallback implementation of GetTID using pthread_getspecific. -ABSL_CONST_INIT static once_flag tid_once; -ABSL_CONST_INIT static pthread_key_t tid_key; -ABSL_CONST_INIT static y_absl::base_internal::SpinLock tid_lock( +Y_ABSL_CONST_INIT static once_flag tid_once; +Y_ABSL_CONST_INIT static pthread_key_t tid_key; +Y_ABSL_CONST_INIT static y_absl::base_internal::SpinLock tid_lock( y_absl::kConstInit, base_internal::SCHEDULE_KERNEL_ONLY); // We set a bit per thread in this array to indicate that an ID is in // use. ID 0 is unused because it is the default value returned by // pthread_getspecific(). -ABSL_CONST_INIT static std::vector<uint32_t> *tid_array - ABSL_GUARDED_BY(tid_lock) = nullptr; +Y_ABSL_CONST_INIT static std::vector<uint32_t> *tid_array + Y_ABSL_GUARDED_BY(tid_lock) = nullptr; static constexpr int kBitsPerWord = 32; // tid_array is uint32_t. // Returns the TID to tid_array. @@ -495,14 +495,14 @@ pid_t GetTID() { // userspace construct) to avoid unnecessary system calls. Without this caching, // it can take roughly 98ns, while it takes roughly 1ns with this caching. pid_t GetCachedTID() { -#ifdef ABSL_HAVE_THREAD_LOCAL +#ifdef Y_ABSL_HAVE_THREAD_LOCAL static thread_local pid_t thread_id = GetTID(); return thread_id; #else return GetTID(); -#endif // ABSL_HAVE_THREAD_LOCAL +#endif // Y_ABSL_HAVE_THREAD_LOCAL } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/sysinfo.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/sysinfo.h index 0fd7207a38..026b4bffc9 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/sysinfo.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/sysinfo.h @@ -21,8 +21,8 @@ // All functions here are thread-hostile due to file caching unless // commented otherwise. -#ifndef ABSL_BASE_INTERNAL_SYSINFO_H_ -#define ABSL_BASE_INTERNAL_SYSINFO_H_ +#ifndef Y_ABSL_BASE_INTERNAL_SYSINFO_H_ +#define Y_ABSL_BASE_INTERNAL_SYSINFO_H_ #ifndef _WIN32 #include <sys/types.h> @@ -34,7 +34,7 @@ #include "y_absl/base/port.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // Nominal core processor cycles per second of each processor. This is _not_ @@ -68,7 +68,7 @@ pid_t GetTID(); pid_t GetCachedTID(); } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_SYSINFO_H_ +#endif // Y_ABSL_BASE_INTERNAL_SYSINFO_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_annotations.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_annotations.h index b4b01a8fb4..248affd621 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_annotations.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_annotations.h @@ -35,8 +35,8 @@ // you want to refer to is not in scope, you may use a member pointer // (e.g. &MyClass::mutex_) to refer to a mutex in some (unknown) object. -#ifndef ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_ -#define ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_ +#ifndef Y_ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_ +#define Y_ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_ #if defined(__clang__) #define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x)) @@ -249,7 +249,7 @@ // Disables warnings for a single read operation. This can be used to avoid // warnings when it is known that the read is not actually involved in a race, // but the compiler cannot confirm that. -#define TS_UNCHECKED_READ(x) thread_safety_analysis::ts_unchecked_read(x) +#define Y_TS_UNCHECKED_READ(x) thread_safety_analysis::y_ts_unchecked_read(x) namespace thread_safety_analysis { @@ -257,15 +257,15 @@ namespace thread_safety_analysis { // Takes a reference to a guarded data member, and returns an unguarded // reference. template <typename T> -inline const T& ts_unchecked_read(const T& v) NO_THREAD_SAFETY_ANALYSIS { +inline const T& y_ts_unchecked_read(const T& v) NO_THREAD_SAFETY_ANALYSIS { return v; } template <typename T> -inline T& ts_unchecked_read(T& v) NO_THREAD_SAFETY_ANALYSIS { +inline T& y_ts_unchecked_read(T& v) NO_THREAD_SAFETY_ANALYSIS { return v; } } // namespace thread_safety_analysis -#endif // ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_ +#endif // Y_ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.cc index b5e88ae302..9e67f0b964 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.cc @@ -29,10 +29,10 @@ #include "y_absl/base/internal/spinlock.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { -#if ABSL_THREAD_IDENTITY_MODE != ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +#if Y_ABSL_THREAD_IDENTITY_MODE != Y_ABSL_THREAD_IDENTITY_MODE_USE_CPP11 namespace { // Used to co-ordinate one-time creation of our pthread_key y_absl::once_flag init_thread_identity_key_once; @@ -46,8 +46,8 @@ void AllocateThreadIdentityKey(ThreadIdentityReclaimerFunction reclaimer) { } // namespace #endif -#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ - ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +#if Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ + Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_CPP11 // The actual TLS storage for a thread's currently associated ThreadIdentity. // This is referenced by inline accessors in the header. // "protected" visibility ensures that if multiple instances of Abseil code @@ -56,15 +56,15 @@ void AllocateThreadIdentityKey(ThreadIdentityReclaimerFunction reclaimer) { // *different* instances of this ptr. // Apple platforms have the visibility attribute, but issue a compile warning // that protected visibility is unsupported. -#if ABSL_HAVE_ATTRIBUTE(visibility) && !defined(__APPLE__) +#if Y_ABSL_HAVE_ATTRIBUTE(visibility) && !defined(__APPLE__) __attribute__((visibility("protected"))) -#endif // ABSL_HAVE_ATTRIBUTE(visibility) && !defined(__APPLE__) -#if ABSL_PER_THREAD_TLS +#endif // Y_ABSL_HAVE_ATTRIBUTE(visibility) && !defined(__APPLE__) +#if Y_ABSL_PER_THREAD_TLS // Prefer __thread to thread_local as benchmarks indicate it is a bit faster. -ABSL_PER_THREAD_TLS_KEYWORD ThreadIdentity* thread_identity_ptr = nullptr; -#elif defined(ABSL_HAVE_THREAD_LOCAL) +Y_ABSL_PER_THREAD_TLS_KEYWORD ThreadIdentity* thread_identity_ptr = nullptr; +#elif defined(Y_ABSL_HAVE_THREAD_LOCAL) thread_local ThreadIdentity* thread_identity_ptr = nullptr; -#endif // ABSL_PER_THREAD_TLS +#endif // Y_ABSL_PER_THREAD_TLS #endif // TLS or CPP11 void SetCurrentThreadIdentity( @@ -73,7 +73,7 @@ void SetCurrentThreadIdentity( // Associate our destructor. // NOTE: This call to pthread_setspecific is currently the only immovable // barrier to CurrentThreadIdentity() always being async signal safe. -#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC +#if Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC // NOTE: Not async-safe. But can be open-coded. y_absl::call_once(init_thread_identity_key_once, AllocateThreadIdentityKey, reclaimer); @@ -100,46 +100,46 @@ void SetCurrentThreadIdentity( pthread_sigmask(SIG_SETMASK, &curr_signals, nullptr); #endif // !__EMSCRIPTEN__ && !__MINGW32__ -#elif ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_TLS +#elif Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_TLS // NOTE: Not async-safe. But can be open-coded. y_absl::call_once(init_thread_identity_key_once, AllocateThreadIdentityKey, reclaimer); pthread_setspecific(thread_identity_pthread_key, reinterpret_cast<void*>(identity)); thread_identity_ptr = identity; -#elif ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +#elif Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_CPP11 thread_local std::unique_ptr<ThreadIdentity, ThreadIdentityReclaimerFunction> holder(identity, reclaimer); thread_identity_ptr = identity; #else -#error Unimplemented ABSL_THREAD_IDENTITY_MODE +#error Unimplemented Y_ABSL_THREAD_IDENTITY_MODE #endif } -#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ - ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +#if Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ + Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_CPP11 // Please see the comment on `CurrentThreadIdentityIfPresent` in // thread_identity.h. When we cannot expose thread_local variables in // headers, we opt for the correct-but-slower option of not inlining this // function. -#ifndef ABSL_INTERNAL_INLINE_CURRENT_THREAD_IDENTITY_IF_PRESENT +#ifndef Y_ABSL_INTERNAL_INLINE_CURRENT_THREAD_IDENTITY_IF_PRESENT ThreadIdentity* CurrentThreadIdentityIfPresent() { return thread_identity_ptr; } #endif #endif void ClearCurrentThreadIdentity() { -#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ - ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +#if Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ + Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_CPP11 thread_identity_ptr = nullptr; -#elif ABSL_THREAD_IDENTITY_MODE == \ - ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC +#elif Y_ABSL_THREAD_IDENTITY_MODE == \ + Y_ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC // pthread_setspecific expected to clear value on destruction assert(CurrentThreadIdentityIfPresent() == nullptr); #endif } -#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC +#if Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC ThreadIdentity* CurrentThreadIdentityIfPresent() { bool initialized = pthread_key_initialized.load(std::memory_order_acquire); if (!initialized) { @@ -151,5 +151,5 @@ ThreadIdentity* CurrentThreadIdentityIfPresent() { #endif } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.h index 09a6c0bce1..5556ba40b5 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/thread_identity.h @@ -17,8 +17,8 @@ // When a thread terminates, its ThreadIdentity object may be reused for a // thread created later. -#ifndef ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_ -#define ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_ +#ifndef Y_ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_ +#define Y_ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_ #ifndef _WIN32 #include <pthread.h> @@ -35,7 +35,7 @@ #include "y_absl/base/optimization.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN struct SynchLocksHeld; struct SynchWaitParams; @@ -187,51 +187,51 @@ void ClearCurrentThreadIdentity(); // May be chosen at compile time via: -DABSL_FORCE_THREAD_IDENTITY_MODE=<mode // index> -#ifdef ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC -#error ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC cannot be directly set +#ifdef Y_ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC +#error Y_ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC cannot be directly set #else -#define ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC 0 +#define Y_ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC 0 #endif -#ifdef ABSL_THREAD_IDENTITY_MODE_USE_TLS -#error ABSL_THREAD_IDENTITY_MODE_USE_TLS cannot be directly set +#ifdef Y_ABSL_THREAD_IDENTITY_MODE_USE_TLS +#error Y_ABSL_THREAD_IDENTITY_MODE_USE_TLS cannot be directly set #else -#define ABSL_THREAD_IDENTITY_MODE_USE_TLS 1 +#define Y_ABSL_THREAD_IDENTITY_MODE_USE_TLS 1 #endif -#ifdef ABSL_THREAD_IDENTITY_MODE_USE_CPP11 -#error ABSL_THREAD_IDENTITY_MODE_USE_CPP11 cannot be directly set +#ifdef Y_ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +#error Y_ABSL_THREAD_IDENTITY_MODE_USE_CPP11 cannot be directly set #else -#define ABSL_THREAD_IDENTITY_MODE_USE_CPP11 2 +#define Y_ABSL_THREAD_IDENTITY_MODE_USE_CPP11 2 #endif -#ifdef ABSL_THREAD_IDENTITY_MODE -#error ABSL_THREAD_IDENTITY_MODE cannot be directly set -#elif defined(ABSL_FORCE_THREAD_IDENTITY_MODE) -#define ABSL_THREAD_IDENTITY_MODE ABSL_FORCE_THREAD_IDENTITY_MODE +#ifdef Y_ABSL_THREAD_IDENTITY_MODE +#error Y_ABSL_THREAD_IDENTITY_MODE cannot be directly set +#elif defined(Y_ABSL_FORCE_THREAD_IDENTITY_MODE) +#define Y_ABSL_THREAD_IDENTITY_MODE Y_ABSL_FORCE_THREAD_IDENTITY_MODE #elif defined(_WIN32) && !defined(__MINGW32__) -#define ABSL_THREAD_IDENTITY_MODE ABSL_THREAD_IDENTITY_MODE_USE_CPP11 -#elif defined(__APPLE__) && defined(ABSL_HAVE_THREAD_LOCAL) -#define ABSL_THREAD_IDENTITY_MODE ABSL_THREAD_IDENTITY_MODE_USE_CPP11 -#elif ABSL_PER_THREAD_TLS && defined(__GOOGLE_GRTE_VERSION__) && \ +#define Y_ABSL_THREAD_IDENTITY_MODE Y_ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +#elif defined(__APPLE__) && defined(Y_ABSL_HAVE_THREAD_LOCAL) +#define Y_ABSL_THREAD_IDENTITY_MODE Y_ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +#elif Y_ABSL_PER_THREAD_TLS && defined(__GOOGLE_GRTE_VERSION__) && \ (__GOOGLE_GRTE_VERSION__ >= 20140228L) // Support for async-safe TLS was specifically added in GRTEv4. It's not // present in the upstream eglibc. // Note: Current default for production systems. -#define ABSL_THREAD_IDENTITY_MODE ABSL_THREAD_IDENTITY_MODE_USE_TLS +#define Y_ABSL_THREAD_IDENTITY_MODE Y_ABSL_THREAD_IDENTITY_MODE_USE_TLS #else -#define ABSL_THREAD_IDENTITY_MODE \ - ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC +#define Y_ABSL_THREAD_IDENTITY_MODE \ + Y_ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC #endif -#if ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ - ABSL_THREAD_IDENTITY_MODE == ABSL_THREAD_IDENTITY_MODE_USE_CPP11 +#if Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_TLS || \ + Y_ABSL_THREAD_IDENTITY_MODE == Y_ABSL_THREAD_IDENTITY_MODE_USE_CPP11 -#if ABSL_PER_THREAD_TLS -ABSL_CONST_INIT extern ABSL_PER_THREAD_TLS_KEYWORD ThreadIdentity* +#if Y_ABSL_PER_THREAD_TLS +Y_ABSL_CONST_INIT extern Y_ABSL_PER_THREAD_TLS_KEYWORD ThreadIdentity* thread_identity_ptr; -#elif defined(ABSL_HAVE_THREAD_LOCAL) -ABSL_CONST_INIT extern thread_local ThreadIdentity* thread_identity_ptr; +#elif defined(Y_ABSL_HAVE_THREAD_LOCAL) +Y_ABSL_CONST_INIT extern thread_local ThreadIdentity* thread_identity_ptr; #else #error Thread-local storage not detected on this platform #endif @@ -242,24 +242,24 @@ ABSL_CONST_INIT extern thread_local ThreadIdentity* thread_identity_ptr; // inlined. In the other cases we opt to have the function not be inlined. Note // that `CurrentThreadIdentityIfPresent` is declared above so we can exclude // this entire inline definition. -#if !defined(__APPLE__) && !defined(ABSL_BUILD_DLL) && \ - !defined(ABSL_CONSUME_DLL) -#define ABSL_INTERNAL_INLINE_CURRENT_THREAD_IDENTITY_IF_PRESENT 1 +#if !defined(__APPLE__) && !defined(Y_ABSL_BUILD_DLL) && \ + !defined(Y_ABSL_CONSUME_DLL) +#define Y_ABSL_INTERNAL_INLINE_CURRENT_THREAD_IDENTITY_IF_PRESENT 1 #endif -#ifdef ABSL_INTERNAL_INLINE_CURRENT_THREAD_IDENTITY_IF_PRESENT +#ifdef Y_ABSL_INTERNAL_INLINE_CURRENT_THREAD_IDENTITY_IF_PRESENT inline ThreadIdentity* CurrentThreadIdentityIfPresent() { return thread_identity_ptr; } #endif -#elif ABSL_THREAD_IDENTITY_MODE != \ - ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC -#error Unknown ABSL_THREAD_IDENTITY_MODE +#elif Y_ABSL_THREAD_IDENTITY_MODE != \ + Y_ABSL_THREAD_IDENTITY_MODE_USE_POSIX_SETSPECIFIC +#error Unknown Y_ABSL_THREAD_IDENTITY_MODE #endif } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_ +#endif // Y_ABSL_BASE_INTERNAL_THREAD_IDENTITY_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate.cc index dcce5aedc3..e938d7dcc2 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate.cc @@ -23,7 +23,7 @@ #include "y_absl/base/internal/raw_logging.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // NOTE: The various STL exception throwing functions are placed within the @@ -31,7 +31,7 @@ namespace base_internal { // them, such as the Android NDK. For example, ANGLE fails to link when building // within AOSP without them, since the STL functions don't exist. namespace { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS template <typename T> [[noreturn]] void Throw(const T& error) { throw error; @@ -40,159 +40,159 @@ template <typename T> } // namespace void ThrowStdLogicError(const TString& what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::logic_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); std::abort(); #endif } void ThrowStdLogicError(const char* what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::logic_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg); std::abort(); #endif } void ThrowStdInvalidArgument(const TString& what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::invalid_argument(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); std::abort(); #endif } void ThrowStdInvalidArgument(const char* what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::invalid_argument(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg); std::abort(); #endif } void ThrowStdDomainError(const TString& what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::domain_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); std::abort(); #endif } void ThrowStdDomainError(const char* what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::domain_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg); std::abort(); #endif } void ThrowStdLengthError(const TString& what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::length_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); std::abort(); #endif } void ThrowStdLengthError(const char* what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::length_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg); std::abort(); #endif } void ThrowStdOutOfRange(const TString& what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::out_of_range(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); std::abort(); #endif } void ThrowStdOutOfRange(const char* what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::out_of_range(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg); std::abort(); #endif } void ThrowStdRuntimeError(const TString& what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::runtime_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); std::abort(); #endif } void ThrowStdRuntimeError(const char* what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::runtime_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg); std::abort(); #endif } void ThrowStdRangeError(const TString& what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::range_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); std::abort(); #endif } void ThrowStdRangeError(const char* what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::range_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg); std::abort(); #endif } void ThrowStdOverflowError(const TString& what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::overflow_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); std::abort(); #endif } void ThrowStdOverflowError(const char* what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::overflow_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg); std::abort(); #endif } void ThrowStdUnderflowError(const TString& what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::underflow_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg.c_str()); std::abort(); #endif } void ThrowStdUnderflowError(const char* what_arg) { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::underflow_error(what_arg)); #else - ABSL_RAW_LOG(FATAL, "%s", what_arg); + Y_ABSL_RAW_LOG(FATAL, "%s", what_arg); std::abort(); #endif } void ThrowStdBadFunctionCall() { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::bad_function_call()); #else std::abort(); @@ -200,7 +200,7 @@ void ThrowStdBadFunctionCall() { } void ThrowStdBadAlloc() { -#ifdef ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS Throw(std::bad_alloc()); #else std::abort(); @@ -208,5 +208,5 @@ void ThrowStdBadAlloc() { } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate.h index fda03a5db3..8f784fb115 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/throw_delegate.h @@ -14,15 +14,15 @@ // limitations under the License. // -#ifndef ABSL_BASE_INTERNAL_THROW_DELEGATE_H_ -#define ABSL_BASE_INTERNAL_THROW_DELEGATE_H_ +#ifndef Y_ABSL_BASE_INTERNAL_THROW_DELEGATE_H_ +#define Y_ABSL_BASE_INTERNAL_THROW_DELEGATE_H_ #include <util/generic/string.h> #include "y_absl/base/config.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // Helper functions that allow throwing exceptions consistently from anywhere. @@ -69,7 +69,7 @@ namespace base_internal { // [[noreturn]] void ThrowStdBadArrayNewLength(); } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_INTERNAL_THROW_DELEGATE_H_ +#endif // Y_ABSL_BASE_INTERNAL_THROW_DELEGATE_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/tsan_mutex_interface.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/tsan_mutex_interface.h index 69a61d0814..7bdaf57dd7 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/tsan_mutex_interface.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/tsan_mutex_interface.h @@ -16,53 +16,53 @@ // It provides ThreadSanitizer annotations for custom mutexes. // See <sanitizer/tsan_interface.h> for meaning of these annotations. -#ifndef ABSL_BASE_INTERNAL_TSAN_MUTEX_INTERFACE_H_ -#define ABSL_BASE_INTERNAL_TSAN_MUTEX_INTERFACE_H_ +#ifndef Y_ABSL_BASE_INTERNAL_TSAN_MUTEX_INTERFACE_H_ +#define Y_ABSL_BASE_INTERNAL_TSAN_MUTEX_INTERFACE_H_ #include "y_absl/base/config.h" -// ABSL_INTERNAL_HAVE_TSAN_INTERFACE +// Y_ABSL_INTERNAL_HAVE_TSAN_INTERFACE // Macro intended only for internal use. // // Checks whether LLVM Thread Sanitizer interfaces are available. // First made available in LLVM 5.0 (Sep 2017). -#ifdef ABSL_INTERNAL_HAVE_TSAN_INTERFACE -#error "ABSL_INTERNAL_HAVE_TSAN_INTERFACE cannot be directly set." +#ifdef Y_ABSL_INTERNAL_HAVE_TSAN_INTERFACE +#error "Y_ABSL_INTERNAL_HAVE_TSAN_INTERFACE cannot be directly set." #endif -#if defined(ABSL_HAVE_THREAD_SANITIZER) && defined(__has_include) +#if defined(Y_ABSL_HAVE_THREAD_SANITIZER) && defined(__has_include) #if __has_include(<sanitizer/tsan_interface.h>) -#define ABSL_INTERNAL_HAVE_TSAN_INTERFACE 1 +#define Y_ABSL_INTERNAL_HAVE_TSAN_INTERFACE 1 #endif #endif -#ifdef ABSL_INTERNAL_HAVE_TSAN_INTERFACE +#ifdef Y_ABSL_INTERNAL_HAVE_TSAN_INTERFACE #include <sanitizer/tsan_interface.h> -#define ABSL_TSAN_MUTEX_CREATE __tsan_mutex_create -#define ABSL_TSAN_MUTEX_DESTROY __tsan_mutex_destroy -#define ABSL_TSAN_MUTEX_PRE_LOCK __tsan_mutex_pre_lock -#define ABSL_TSAN_MUTEX_POST_LOCK __tsan_mutex_post_lock -#define ABSL_TSAN_MUTEX_PRE_UNLOCK __tsan_mutex_pre_unlock -#define ABSL_TSAN_MUTEX_POST_UNLOCK __tsan_mutex_post_unlock -#define ABSL_TSAN_MUTEX_PRE_SIGNAL __tsan_mutex_pre_signal -#define ABSL_TSAN_MUTEX_POST_SIGNAL __tsan_mutex_post_signal -#define ABSL_TSAN_MUTEX_PRE_DIVERT __tsan_mutex_pre_divert -#define ABSL_TSAN_MUTEX_POST_DIVERT __tsan_mutex_post_divert +#define Y_ABSL_TSAN_MUTEX_CREATE __tsan_mutex_create +#define Y_ABSL_TSAN_MUTEX_DESTROY __tsan_mutex_destroy +#define Y_ABSL_TSAN_MUTEX_PRE_LOCK __tsan_mutex_pre_lock +#define Y_ABSL_TSAN_MUTEX_POST_LOCK __tsan_mutex_post_lock +#define Y_ABSL_TSAN_MUTEX_PRE_UNLOCK __tsan_mutex_pre_unlock +#define Y_ABSL_TSAN_MUTEX_POST_UNLOCK __tsan_mutex_post_unlock +#define Y_ABSL_TSAN_MUTEX_PRE_SIGNAL __tsan_mutex_pre_signal +#define Y_ABSL_TSAN_MUTEX_POST_SIGNAL __tsan_mutex_post_signal +#define Y_ABSL_TSAN_MUTEX_PRE_DIVERT __tsan_mutex_pre_divert +#define Y_ABSL_TSAN_MUTEX_POST_DIVERT __tsan_mutex_post_divert #else -#define ABSL_TSAN_MUTEX_CREATE(...) -#define ABSL_TSAN_MUTEX_DESTROY(...) -#define ABSL_TSAN_MUTEX_PRE_LOCK(...) -#define ABSL_TSAN_MUTEX_POST_LOCK(...) -#define ABSL_TSAN_MUTEX_PRE_UNLOCK(...) -#define ABSL_TSAN_MUTEX_POST_UNLOCK(...) -#define ABSL_TSAN_MUTEX_PRE_SIGNAL(...) -#define ABSL_TSAN_MUTEX_POST_SIGNAL(...) -#define ABSL_TSAN_MUTEX_PRE_DIVERT(...) -#define ABSL_TSAN_MUTEX_POST_DIVERT(...) +#define Y_ABSL_TSAN_MUTEX_CREATE(...) +#define Y_ABSL_TSAN_MUTEX_DESTROY(...) +#define Y_ABSL_TSAN_MUTEX_PRE_LOCK(...) +#define Y_ABSL_TSAN_MUTEX_POST_LOCK(...) +#define Y_ABSL_TSAN_MUTEX_PRE_UNLOCK(...) +#define Y_ABSL_TSAN_MUTEX_POST_UNLOCK(...) +#define Y_ABSL_TSAN_MUTEX_PRE_SIGNAL(...) +#define Y_ABSL_TSAN_MUTEX_POST_SIGNAL(...) +#define Y_ABSL_TSAN_MUTEX_PRE_DIVERT(...) +#define Y_ABSL_TSAN_MUTEX_POST_DIVERT(...) #endif -#endif // ABSL_BASE_INTERNAL_TSAN_MUTEX_INTERFACE_H_ +#endif // Y_ABSL_BASE_INTERNAL_TSAN_MUTEX_INTERFACE_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unaligned_access.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unaligned_access.h index 7dbb23b1de..3820dde737 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unaligned_access.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unaligned_access.h @@ -14,8 +14,8 @@ // limitations under the License. // -#ifndef ABSL_BASE_INTERNAL_UNALIGNED_ACCESS_H_ -#define ABSL_BASE_INTERNAL_UNALIGNED_ACCESS_H_ +#ifndef Y_ABSL_BASE_INTERNAL_UNALIGNED_ACCESS_H_ +#define Y_ABSL_BASE_INTERNAL_UNALIGNED_ACCESS_H_ #include <string.h> @@ -32,7 +32,7 @@ // (namespaces, inline) which are absent or incompatible in C. #if defined(__cplusplus) namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { inline uint16_t UnalignedLoad16(const void *p) { @@ -60,23 +60,23 @@ inline void UnalignedStore32(void *p, uint32_t v) { memcpy(p, &v, sizeof v); } inline void UnalignedStore64(void *p, uint64_t v) { memcpy(p, &v, sizeof v); } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#define ABSL_INTERNAL_UNALIGNED_LOAD16(_p) \ +#define Y_ABSL_INTERNAL_UNALIGNED_LOAD16(_p) \ (y_absl::base_internal::UnalignedLoad16(_p)) -#define ABSL_INTERNAL_UNALIGNED_LOAD32(_p) \ +#define Y_ABSL_INTERNAL_UNALIGNED_LOAD32(_p) \ (y_absl::base_internal::UnalignedLoad32(_p)) -#define ABSL_INTERNAL_UNALIGNED_LOAD64(_p) \ +#define Y_ABSL_INTERNAL_UNALIGNED_LOAD64(_p) \ (y_absl::base_internal::UnalignedLoad64(_p)) -#define ABSL_INTERNAL_UNALIGNED_STORE16(_p, _val) \ +#define Y_ABSL_INTERNAL_UNALIGNED_STORE16(_p, _val) \ (y_absl::base_internal::UnalignedStore16(_p, _val)) -#define ABSL_INTERNAL_UNALIGNED_STORE32(_p, _val) \ +#define Y_ABSL_INTERNAL_UNALIGNED_STORE32(_p, _val) \ (y_absl::base_internal::UnalignedStore32(_p, _val)) -#define ABSL_INTERNAL_UNALIGNED_STORE64(_p, _val) \ +#define Y_ABSL_INTERNAL_UNALIGNED_STORE64(_p, _val) \ (y_absl::base_internal::UnalignedStore64(_p, _val)) #endif // defined(__cplusplus), end of unaligned API -#endif // ABSL_BASE_INTERNAL_UNALIGNED_ACCESS_H_ +#endif // Y_ABSL_BASE_INTERNAL_UNALIGNED_ACCESS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unscaledcycleclock.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unscaledcycleclock.cc index 072a9852fa..dcbcb0c24d 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unscaledcycleclock.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unscaledcycleclock.cc @@ -14,7 +14,7 @@ #include "y_absl/base/internal/unscaledcycleclock.h" -#if ABSL_USE_UNSCALED_CYCLECLOCK +#if Y_ABSL_USE_UNSCALED_CYCLECLOCK #if defined(_WIN32) #include <intrin.h> @@ -32,7 +32,7 @@ #include "y_absl/base/internal/sysinfo.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { #if defined(__i386__) @@ -148,7 +148,7 @@ double UnscaledCycleClock::Frequency() { #endif } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_USE_UNSCALED_CYCLECLOCK +#endif // Y_ABSL_USE_UNSCALED_CYCLECLOCK diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unscaledcycleclock.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unscaledcycleclock.h index 618c5c7e73..fd82752f78 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unscaledcycleclock.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/internal/unscaledcycleclock.h @@ -33,8 +33,8 @@ // The CPU is not required to maintain the ordering of a cycle counter read // with respect to surrounding instructions. -#ifndef ABSL_BASE_INTERNAL_UNSCALEDCYCLECLOCK_H_ -#define ABSL_BASE_INTERNAL_UNSCALEDCYCLECLOCK_H_ +#ifndef Y_ABSL_BASE_INTERNAL_UNSCALEDCYCLECLOCK_H_ +#define Y_ABSL_BASE_INTERNAL_UNSCALEDCYCLECLOCK_H_ #include <cstdint> @@ -48,9 +48,9 @@ #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ defined(__powerpc__) || defined(__ppc__) || defined(__riscv) || \ defined(_M_IX86) || defined(_M_X64) -#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 +#define Y_ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 #else -#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 0 +#define Y_ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 0 #endif // The following platforms often disable access to the hardware @@ -62,31 +62,31 @@ #if defined(__native_client__) || \ (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) || \ (defined(__ANDROID__) && defined(__aarch64__)) -#define ABSL_USE_UNSCALED_CYCLECLOCK_DEFAULT 0 +#define Y_ABSL_USE_UNSCALED_CYCLECLOCK_DEFAULT 0 #else -#define ABSL_USE_UNSCALED_CYCLECLOCK_DEFAULT 1 +#define Y_ABSL_USE_UNSCALED_CYCLECLOCK_DEFAULT 1 #endif // UnscaledCycleClock is an optional internal feature. -// Use "#if ABSL_USE_UNSCALED_CYCLECLOCK" to test for its presence. +// Use "#if Y_ABSL_USE_UNSCALED_CYCLECLOCK" to test for its presence. // Can be overridden at compile-time via -DABSL_USE_UNSCALED_CYCLECLOCK=0|1 -#if !defined(ABSL_USE_UNSCALED_CYCLECLOCK) -#define ABSL_USE_UNSCALED_CYCLECLOCK \ - (ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION && \ - ABSL_USE_UNSCALED_CYCLECLOCK_DEFAULT) +#if !defined(Y_ABSL_USE_UNSCALED_CYCLECLOCK) +#define Y_ABSL_USE_UNSCALED_CYCLECLOCK \ + (Y_ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION && \ + Y_ABSL_USE_UNSCALED_CYCLECLOCK_DEFAULT) #endif -#if ABSL_USE_UNSCALED_CYCLECLOCK +#if Y_ABSL_USE_UNSCALED_CYCLECLOCK // This macro can be used to test if UnscaledCycleClock::Frequency() // is NominalCPUFrequency() on a particular platform. #if (defined(__i386__) || defined(__x86_64__) || defined(__riscv) || \ defined(_M_IX86) || defined(_M_X64)) -#define ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY +#define Y_ABSL_INTERNAL_UNSCALED_CYCLECLOCK_FREQUENCY_IS_CPU_FREQUENCY #endif namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace time_internal { class UnscaledCycleClockWrapperForGetCurrentTime; } // namespace time_internal @@ -116,9 +116,9 @@ class UnscaledCycleClock { }; } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_USE_UNSCALED_CYCLECLOCK +#endif // Y_ABSL_USE_UNSCALED_CYCLECLOCK -#endif // ABSL_BASE_INTERNAL_UNSCALEDCYCLECLOCK_H_ +#endif // Y_ABSL_BASE_INTERNAL_UNSCALEDCYCLECLOCK_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.cc b/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.cc index 2ae8c75aec..3212ba04c9 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.cc +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.cc @@ -17,11 +17,11 @@ #include <ostream> namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN std::ostream& operator<<(std::ostream& os, y_absl::LogSeverity s) { if (s == y_absl::NormalizeLogSeverity(s)) return os << y_absl::LogSeverityName(s); return os << "y_absl::LogSeverity(" << static_cast<int>(s) << ")"; } -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.h index 26f20ad8e1..07ee164f45 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/log_severity.h @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef ABSL_BASE_LOG_SEVERITY_H_ -#define ABSL_BASE_LOG_SEVERITY_H_ +#ifndef Y_ABSL_BASE_LOG_SEVERITY_H_ +#define Y_ABSL_BASE_LOG_SEVERITY_H_ #include <array> #include <ostream> @@ -22,7 +22,7 @@ #include "y_absl/base/config.h" namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN // y_absl::LogSeverity // @@ -115,7 +115,7 @@ constexpr y_absl::LogSeverity NormalizeLogSeverity(int s) { // unspecified; do not rely on it. std::ostream& operator<<(std::ostream& os, y_absl::LogSeverity s); -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_LOG_SEVERITY_H_ +#endif // Y_ABSL_BASE_LOG_SEVERITY_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/macros.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/macros.h index b09a81877d..1caf95d46e 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/macros.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/macros.h @@ -25,8 +25,8 @@ // platforms like Windows, Mac, and embedded systems. Before making // any changes here, make sure that you're not breaking any platforms. -#ifndef ABSL_BASE_MACROS_H_ -#define ABSL_BASE_MACROS_H_ +#ifndef Y_ABSL_BASE_MACROS_H_ +#define Y_ABSL_BASE_MACROS_H_ #include <cassert> #include <cstddef> @@ -36,26 +36,26 @@ #include "y_absl/base/optimization.h" #include "y_absl/base/port.h" -// ABSL_ARRAYSIZE() +// Y_ABSL_ARRAYSIZE() // // Returns the number of elements in an array as a compile-time constant, which // can be used in defining new arrays. If you use this macro on a pointer by // mistake, you will get a compile-time error. -#define ABSL_ARRAYSIZE(array) \ +#define Y_ABSL_ARRAYSIZE(array) \ (sizeof(::y_absl::macros_internal::ArraySizeHelper(array))) namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace macros_internal { -// Note: this internal template function declaration is used by ABSL_ARRAYSIZE. +// Note: this internal template function declaration is used by Y_ABSL_ARRAYSIZE. // The function doesn't need a definition, as we only use its type. template <typename T, size_t N> auto ArraySizeHelper(const T (&array)[N]) -> char (&)[N]; } // namespace macros_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -// ABSL_BAD_CALL_IF() +// Y_ABSL_BAD_CALL_IF() // // Used on a function overload to trap bad calls: any call that matches the // overload will cause a compile-time error. This macro uses a clang-specific @@ -63,96 +63,96 @@ ABSL_NAMESPACE_END // https://clang.llvm.org/docs/AttributeReference.html#enable-if // // Overloads which use this macro should be bracketed by -// `#ifdef ABSL_BAD_CALL_IF`. +// `#ifdef Y_ABSL_BAD_CALL_IF`. // // Example: // // int isdigit(int c); -// #ifdef ABSL_BAD_CALL_IF +// #ifdef Y_ABSL_BAD_CALL_IF // int isdigit(int c) -// ABSL_BAD_CALL_IF(c <= -1 || c > 255, +// Y_ABSL_BAD_CALL_IF(c <= -1 || c > 255, // "'c' must have the value of an unsigned char or EOF"); -// #endif // ABSL_BAD_CALL_IF -#if ABSL_HAVE_ATTRIBUTE(enable_if) -#define ABSL_BAD_CALL_IF(expr, msg) \ +// #endif // Y_ABSL_BAD_CALL_IF +#if Y_ABSL_HAVE_ATTRIBUTE(enable_if) +#define Y_ABSL_BAD_CALL_IF(expr, msg) \ __attribute__((enable_if(expr, "Bad call trap"), unavailable(msg))) #endif -// ABSL_ASSERT() +// Y_ABSL_ASSERT() // // In C++11, `assert` can't be used portably within constexpr functions. -// ABSL_ASSERT functions as a runtime assert but works in C++11 constexpr +// Y_ABSL_ASSERT functions as a runtime assert but works in C++11 constexpr // functions. Example: // // constexpr double Divide(double a, double b) { -// return ABSL_ASSERT(b != 0), a / b; +// return Y_ABSL_ASSERT(b != 0), a / b; // } // // This macro is inspired by // https://akrzemi1.wordpress.com/2017/05/18/asserts-in-constexpr-functions/ #if defined(NDEBUG) -#define ABSL_ASSERT(expr) \ +#define Y_ABSL_ASSERT(expr) \ (false ? static_cast<void>(expr) : static_cast<void>(0)) #else -#define ABSL_ASSERT(expr) \ - (ABSL_PREDICT_TRUE((expr)) ? static_cast<void>(0) \ +#define Y_ABSL_ASSERT(expr) \ + (Y_ABSL_PREDICT_TRUE((expr)) ? static_cast<void>(0) \ : [] { assert(false && #expr); }()) // NOLINT #endif -// `ABSL_INTERNAL_HARDENING_ABORT()` controls how `ABSL_HARDENING_ASSERT()` +// `Y_ABSL_INTERNAL_HARDENING_ABORT()` controls how `Y_ABSL_HARDENING_ASSERT()` // aborts the program in release mode (when NDEBUG is defined). The // implementation should abort the program as quickly as possible and ideally it // should not be possible to ignore the abort request. -#if (ABSL_HAVE_BUILTIN(__builtin_trap) && \ - ABSL_HAVE_BUILTIN(__builtin_unreachable)) || \ +#if (Y_ABSL_HAVE_BUILTIN(__builtin_trap) && \ + Y_ABSL_HAVE_BUILTIN(__builtin_unreachable)) || \ (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_INTERNAL_HARDENING_ABORT() \ +#define Y_ABSL_INTERNAL_HARDENING_ABORT() \ do { \ __builtin_trap(); \ __builtin_unreachable(); \ } while (false) #else -#define ABSL_INTERNAL_HARDENING_ABORT() abort() +#define Y_ABSL_INTERNAL_HARDENING_ABORT() abort() #endif -// ABSL_HARDENING_ASSERT() +// Y_ABSL_HARDENING_ASSERT() // -// `ABSL_HARDENING_ASSERT()` is like `ABSL_ASSERT()`, but used to implement +// `Y_ABSL_HARDENING_ASSERT()` is like `Y_ABSL_ASSERT()`, but used to implement // runtime assertions that should be enabled in hardened builds even when // `NDEBUG` is defined. // -// When `NDEBUG` is not defined, `ABSL_HARDENING_ASSERT()` is identical to -// `ABSL_ASSERT()`. +// When `NDEBUG` is not defined, `Y_ABSL_HARDENING_ASSERT()` is identical to +// `Y_ABSL_ASSERT()`. // -// See `ABSL_OPTION_HARDENED` in `y_absl/base/options.h` for more information on +// See `Y_ABSL_OPTION_HARDENED` in `y_absl/base/options.h` for more information on // hardened mode. -#if ABSL_OPTION_HARDENED == 1 && defined(NDEBUG) -#define ABSL_HARDENING_ASSERT(expr) \ - (ABSL_PREDICT_TRUE((expr)) ? static_cast<void>(0) \ - : [] { ABSL_INTERNAL_HARDENING_ABORT(); }()) +#if Y_ABSL_OPTION_HARDENED == 1 && defined(NDEBUG) +#define Y_ABSL_HARDENING_ASSERT(expr) \ + (Y_ABSL_PREDICT_TRUE((expr)) ? static_cast<void>(0) \ + : [] { Y_ABSL_INTERNAL_HARDENING_ABORT(); }()) #else -#define ABSL_HARDENING_ASSERT(expr) ABSL_ASSERT(expr) +#define Y_ABSL_HARDENING_ASSERT(expr) Y_ABSL_ASSERT(expr) #endif -#ifdef ABSL_HAVE_EXCEPTIONS -#define ABSL_INTERNAL_TRY try -#define ABSL_INTERNAL_CATCH_ANY catch (...) -#define ABSL_INTERNAL_RETHROW do { throw; } while (false) -#else // ABSL_HAVE_EXCEPTIONS -#define ABSL_INTERNAL_TRY if (true) -#define ABSL_INTERNAL_CATCH_ANY else if (false) -#define ABSL_INTERNAL_RETHROW do {} while (false) -#endif // ABSL_HAVE_EXCEPTIONS +#ifdef Y_ABSL_HAVE_EXCEPTIONS +#define Y_ABSL_INTERNAL_TRY try +#define Y_ABSL_INTERNAL_CATCH_ANY catch (...) +#define Y_ABSL_INTERNAL_RETHROW do { throw; } while (false) +#else // Y_ABSL_HAVE_EXCEPTIONS +#define Y_ABSL_INTERNAL_TRY if (true) +#define Y_ABSL_INTERNAL_CATCH_ANY else if (false) +#define Y_ABSL_INTERNAL_RETHROW do {} while (false) +#endif // Y_ABSL_HAVE_EXCEPTIONS -// `ABSL_INTERNAL_UNREACHABLE` is an unreachable statement. A program which +// `Y_ABSL_INTERNAL_UNREACHABLE` is an unreachable statement. A program which // reaches one has undefined behavior, and the compiler may optimize // accordingly. -#if defined(__GNUC__) || ABSL_HAVE_BUILTIN(__builtin_unreachable) -#define ABSL_INTERNAL_UNREACHABLE __builtin_unreachable() +#if defined(__GNUC__) || Y_ABSL_HAVE_BUILTIN(__builtin_unreachable) +#define Y_ABSL_INTERNAL_UNREACHABLE __builtin_unreachable() #elif defined(_MSC_VER) -#define ABSL_INTERNAL_UNREACHABLE __assume(0) +#define Y_ABSL_INTERNAL_UNREACHABLE __assume(0) #else -#define ABSL_INTERNAL_UNREACHABLE +#define Y_ABSL_INTERNAL_UNREACHABLE #endif -#endif // ABSL_BASE_MACROS_H_ +#endif // Y_ABSL_BASE_MACROS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/optimization.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/optimization.h index 501530ae30..72cf6ef8a2 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/optimization.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/optimization.h @@ -19,14 +19,14 @@ // // This header file defines portable macros for performance optimization. -#ifndef ABSL_BASE_OPTIMIZATION_H_ -#define ABSL_BASE_OPTIMIZATION_H_ +#ifndef Y_ABSL_BASE_OPTIMIZATION_H_ +#define Y_ABSL_BASE_OPTIMIZATION_H_ #include <assert.h> #include "y_absl/base/config.h" -// ABSL_BLOCK_TAIL_CALL_OPTIMIZATION +// Y_ABSL_BLOCK_TAIL_CALL_OPTIMIZATION // // Instructs the compiler to avoid optimizing tail-call recursion. This macro is // useful when you wish to preserve the existing function order within a stack @@ -36,30 +36,30 @@ // // int f() { // int result = g(); -// ABSL_BLOCK_TAIL_CALL_OPTIMIZATION(); +// Y_ABSL_BLOCK_TAIL_CALL_OPTIMIZATION(); // return result; // } #if defined(__pnacl__) -#define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() if (volatile int x = 0) { (void)x; } +#define Y_ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() if (volatile int x = 0) { (void)x; } #elif defined(__clang__) // Clang will not tail call given inline volatile assembly. -#define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __asm__ __volatile__("") +#define Y_ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __asm__ __volatile__("") #elif defined(__GNUC__) // GCC will not tail call given inline volatile assembly. -#define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __asm__ __volatile__("") +#define Y_ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __asm__ __volatile__("") #elif defined(_MSC_VER) #include <intrin.h> // The __nop() intrinsic blocks the optimisation. -#define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __nop() +#define Y_ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() __nop() #else -#define ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() if (volatile int x = 0) { (void)x; } +#define Y_ABSL_BLOCK_TAIL_CALL_OPTIMIZATION() if (volatile int x = 0) { (void)x; } #endif -// ABSL_CACHELINE_SIZE +// Y_ABSL_CACHELINE_SIZE // // Explicitly defines the size of the L1 cache for purposes of alignment. // Setting the cacheline size allows you to specify that certain objects be -// aligned on a cacheline boundary with `ABSL_CACHELINE_ALIGNED` declarations. +// aligned on a cacheline boundary with `Y_ABSL_CACHELINE_ALIGNED` declarations. // (See below.) // // NOTE: this macro should be replaced with the following C++17 features, when @@ -73,35 +73,35 @@ #if defined(__GNUC__) // Cache line alignment #if defined(__i386__) || defined(__x86_64__) -#define ABSL_CACHELINE_SIZE 64 +#define Y_ABSL_CACHELINE_SIZE 64 #elif defined(__powerpc64__) -#define ABSL_CACHELINE_SIZE 128 +#define Y_ABSL_CACHELINE_SIZE 128 #elif defined(__aarch64__) // We would need to read special register ctr_el0 to find out L1 dcache size. // This value is a good estimate based on a real aarch64 machine. -#define ABSL_CACHELINE_SIZE 64 +#define Y_ABSL_CACHELINE_SIZE 64 #elif defined(__arm__) // Cache line sizes for ARM: These values are not strictly correct since // cache line sizes depend on implementations, not architectures. There // are even implementations with cache line sizes configurable at boot // time. #if defined(__ARM_ARCH_5T__) -#define ABSL_CACHELINE_SIZE 32 +#define Y_ABSL_CACHELINE_SIZE 32 #elif defined(__ARM_ARCH_7A__) -#define ABSL_CACHELINE_SIZE 64 +#define Y_ABSL_CACHELINE_SIZE 64 #endif #endif -#ifndef ABSL_CACHELINE_SIZE +#ifndef Y_ABSL_CACHELINE_SIZE // A reasonable default guess. Note that overestimates tend to waste more // space, while underestimates tend to waste more time. -#define ABSL_CACHELINE_SIZE 64 +#define Y_ABSL_CACHELINE_SIZE 64 #endif -// ABSL_CACHELINE_ALIGNED +// Y_ABSL_CACHELINE_ALIGNED // // Indicates that the declared object be cache aligned using -// `ABSL_CACHELINE_SIZE` (see above). Cacheline aligning objects allows you to +// `Y_ABSL_CACHELINE_SIZE` (see above). Cacheline aligning objects allows you to // load a set of related objects in the L1 cache for performance improvements. // Cacheline aligning objects properly allows constructive memory sharing and // prevents destructive (or "false") memory sharing. @@ -114,7 +114,7 @@ // See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0154r1.html // for more information. // -// On some compilers, `ABSL_CACHELINE_ALIGNED` expands to an `__attribute__` +// On some compilers, `Y_ABSL_CACHELINE_ALIGNED` expands to an `__attribute__` // or `__declspec` attribute. For compilers where this is not known to work, // the macro expands to nothing. // @@ -129,9 +129,9 @@ // this attribute, so prefer to put it at the beginning of your declaration. // For example, // -// ABSL_CACHELINE_ALIGNED static Foo* foo = ... +// Y_ABSL_CACHELINE_ALIGNED static Foo* foo = ... // -// class ABSL_CACHELINE_ALIGNED Bar { ... +// class Y_ABSL_CACHELINE_ALIGNED Bar { ... // // Recommendations: // @@ -141,23 +141,23 @@ // the generated machine code. // 3) Prefer applying this attribute to individual variables. Avoid // applying it to types. This tends to localize the effect. -#define ABSL_CACHELINE_ALIGNED __attribute__((aligned(ABSL_CACHELINE_SIZE))) +#define Y_ABSL_CACHELINE_ALIGNED __attribute__((aligned(Y_ABSL_CACHELINE_SIZE))) #elif defined(_MSC_VER) -#define ABSL_CACHELINE_SIZE 64 -#define ABSL_CACHELINE_ALIGNED __declspec(align(ABSL_CACHELINE_SIZE)) +#define Y_ABSL_CACHELINE_SIZE 64 +#define Y_ABSL_CACHELINE_ALIGNED __declspec(align(Y_ABSL_CACHELINE_SIZE)) #else -#define ABSL_CACHELINE_SIZE 64 -#define ABSL_CACHELINE_ALIGNED +#define Y_ABSL_CACHELINE_SIZE 64 +#define Y_ABSL_CACHELINE_ALIGNED #endif -// ABSL_PREDICT_TRUE, ABSL_PREDICT_FALSE +// Y_ABSL_PREDICT_TRUE, Y_ABSL_PREDICT_FALSE // // Enables the compiler to prioritize compilation using static analysis for // likely paths within a boolean branch. // // Example: // -// if (ABSL_PREDICT_TRUE(expression)) { +// if (Y_ABSL_PREDICT_TRUE(expression)) { // return result; // Faster if more likely // } else { // return 0; @@ -172,16 +172,16 @@ // branch in a codebase is likely counterproductive; however, annotating // specific branches that are both hot and consistently mispredicted is likely // to yield performance improvements. -#if ABSL_HAVE_BUILTIN(__builtin_expect) || \ +#if Y_ABSL_HAVE_BUILTIN(__builtin_expect) || \ (defined(__GNUC__) && !defined(__clang__)) -#define ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false)) -#define ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true)) +#define Y_ABSL_PREDICT_FALSE(x) (__builtin_expect(false || (x), false)) +#define Y_ABSL_PREDICT_TRUE(x) (__builtin_expect(false || (x), true)) #else -#define ABSL_PREDICT_FALSE(x) (x) -#define ABSL_PREDICT_TRUE(x) (x) +#define Y_ABSL_PREDICT_FALSE(x) (x) +#define Y_ABSL_PREDICT_TRUE(x) (x) #endif -// ABSL_INTERNAL_ASSUME(cond) +// Y_ABSL_INTERNAL_ASSUME(cond) // Informs the compiler that a condition is always true and that it can assume // it to be true for optimization purposes. The call has undefined behavior if // the condition is false. @@ -192,30 +192,30 @@ // Example: // // int x = ...; -// ABSL_INTERNAL_ASSUME(x >= 0); +// Y_ABSL_INTERNAL_ASSUME(x >= 0); // // The compiler can optimize the division to a simple right shift using the // // assumption specified above. // int y = x / 16; // #if !defined(NDEBUG) -#define ABSL_INTERNAL_ASSUME(cond) assert(cond) -#elif ABSL_HAVE_BUILTIN(__builtin_assume) -#define ABSL_INTERNAL_ASSUME(cond) __builtin_assume(cond) -#elif defined(__GNUC__) || ABSL_HAVE_BUILTIN(__builtin_unreachable) -#define ABSL_INTERNAL_ASSUME(cond) \ +#define Y_ABSL_INTERNAL_ASSUME(cond) assert(cond) +#elif Y_ABSL_HAVE_BUILTIN(__builtin_assume) +#define Y_ABSL_INTERNAL_ASSUME(cond) __builtin_assume(cond) +#elif defined(__GNUC__) || Y_ABSL_HAVE_BUILTIN(__builtin_unreachable) +#define Y_ABSL_INTERNAL_ASSUME(cond) \ do { \ if (!(cond)) __builtin_unreachable(); \ } while (0) #elif defined(_MSC_VER) -#define ABSL_INTERNAL_ASSUME(cond) __assume(cond) +#define Y_ABSL_INTERNAL_ASSUME(cond) __assume(cond) #else -#define ABSL_INTERNAL_ASSUME(cond) \ +#define Y_ABSL_INTERNAL_ASSUME(cond) \ do { \ static_cast<void>(false && (cond)); \ } while (0) #endif -// ABSL_INTERNAL_UNIQUE_SMALL_NAME(cond) +// Y_ABSL_INTERNAL_UNIQUE_SMALL_NAME(cond) // This macro forces small unique name on a static file level symbols like // static local variables or static functions. This is intended to be used in // macro definitions to optimize the cost of generated code. Do NOT use it on @@ -226,19 +226,19 @@ // // #define MY_MACRO(txt) // namespace { -// char VeryVeryLongVarName[] ABSL_INTERNAL_UNIQUE_SMALL_NAME() = txt; -// const char* VeryVeryLongFuncName() ABSL_INTERNAL_UNIQUE_SMALL_NAME(); +// char VeryVeryLongVarName[] Y_ABSL_INTERNAL_UNIQUE_SMALL_NAME() = txt; +// const char* VeryVeryLongFuncName() Y_ABSL_INTERNAL_UNIQUE_SMALL_NAME(); // const char* VeryVeryLongFuncName() { return txt; } // } // #if defined(__GNUC__) -#define ABSL_INTERNAL_UNIQUE_SMALL_NAME2(x) #x -#define ABSL_INTERNAL_UNIQUE_SMALL_NAME1(x) ABSL_INTERNAL_UNIQUE_SMALL_NAME2(x) -#define ABSL_INTERNAL_UNIQUE_SMALL_NAME() \ - asm(ABSL_INTERNAL_UNIQUE_SMALL_NAME1(.y_absl.__COUNTER__)) +#define Y_ABSL_INTERNAL_UNIQUE_SMALL_NAME2(x) #x +#define Y_ABSL_INTERNAL_UNIQUE_SMALL_NAME1(x) Y_ABSL_INTERNAL_UNIQUE_SMALL_NAME2(x) +#define Y_ABSL_INTERNAL_UNIQUE_SMALL_NAME() \ + asm(Y_ABSL_INTERNAL_UNIQUE_SMALL_NAME1(.y_absl.__COUNTER__)) #else -#define ABSL_INTERNAL_UNIQUE_SMALL_NAME() +#define Y_ABSL_INTERNAL_UNIQUE_SMALL_NAME() #endif -#endif // ABSL_BASE_OPTIMIZATION_H_ +#endif // Y_ABSL_BASE_OPTIMIZATION_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/options.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/options.h index 906310cde0..05f05f9410 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/options.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/options.h @@ -64,8 +64,8 @@ // proper Abseil implementation at compile-time, which will not be sufficient // to guarantee ABI stability to package managers. -#ifndef ABSL_BASE_OPTIONS_H_ -#define ABSL_BASE_OPTIONS_H_ +#ifndef Y_ABSL_BASE_OPTIONS_H_ +#define Y_ABSL_BASE_OPTIONS_H_ // Include a standard library header to allow configuration based on the // standard library in use. @@ -77,7 +77,7 @@ // Type Compatibility Options // ----------------------------------------------------------------------------- // -// ABSL_OPTION_USE_STD_ANY +// Y_ABSL_OPTION_USE_STD_ANY // // This option controls whether y_absl::any is implemented as an alias to // std::any, or as an independent implementation. @@ -98,12 +98,12 @@ // For more info, see https://abseil.io/about/design/dropin-types. // // User code should not inspect this macro. To check in the preprocessor if -// y_absl::any is a typedef of std::any, use the feature macro ABSL_USES_STD_ANY. +// y_absl::any is a typedef of std::any, use the feature macro Y_ABSL_USES_STD_ANY. -#define ABSL_OPTION_USE_STD_ANY 2 +#define Y_ABSL_OPTION_USE_STD_ANY 2 -// ABSL_OPTION_USE_STD_OPTIONAL +// Y_ABSL_OPTION_USE_STD_OPTIONAL // // This option controls whether y_absl::optional is implemented as an alias to // std::optional, or as an independent implementation. @@ -125,12 +125,12 @@ // User code should not inspect this macro. To check in the preprocessor if // y_absl::optional is a typedef of std::optional, use the feature macro -// ABSL_USES_STD_OPTIONAL. +// Y_ABSL_USES_STD_OPTIONAL. -#define ABSL_OPTION_USE_STD_OPTIONAL 2 +#define Y_ABSL_OPTION_USE_STD_OPTIONAL 2 -// ABSL_OPTION_USE_STD_STRING_VIEW +// Y_ABSL_OPTION_USE_STD_STRING_VIEW // // This option controls whether y_absl::string_view is implemented as an alias to // std::string_view, or as an independent implementation. @@ -152,11 +152,11 @@ // // User code should not inspect this macro. To check in the preprocessor if // y_absl::string_view is a typedef of std::string_view, use the feature macro -// ABSL_USES_STD_STRING_VIEW. +// Y_ABSL_USES_STD_STRING_VIEW. -#define ABSL_OPTION_USE_STD_STRING_VIEW 2 +#define Y_ABSL_OPTION_USE_STD_STRING_VIEW 2 -// ABSL_OPTION_USE_STD_VARIANT +// Y_ABSL_OPTION_USE_STD_VARIANT // // This option controls whether y_absl::variant is implemented as an alias to // std::variant, or as an independent implementation. @@ -178,13 +178,13 @@ // // User code should not inspect this macro. To check in the preprocessor if // y_absl::variant is a typedef of std::variant, use the feature macro -// ABSL_USES_STD_VARIANT. +// Y_ABSL_USES_STD_VARIANT. -#define ABSL_OPTION_USE_STD_VARIANT 2 +#define Y_ABSL_OPTION_USE_STD_VARIANT 2 -// ABSL_OPTION_USE_INLINE_NAMESPACE -// ABSL_OPTION_INLINE_NAMESPACE_NAME +// Y_ABSL_OPTION_USE_INLINE_NAMESPACE +// Y_ABSL_OPTION_INLINE_NAMESPACE_NAME // // These options controls whether all entities in the y_absl namespace are // contained within an inner inline namespace. This does not affect the @@ -201,14 +201,14 @@ // A value of 0 means not to use inline namespaces. // // A value of 1 means to use an inline namespace with the given name inside -// namespace y_absl. If this is set, ABSL_OPTION_INLINE_NAMESPACE_NAME must also +// namespace y_absl. If this is set, Y_ABSL_OPTION_INLINE_NAMESPACE_NAME must also // be changed to a new, unique identifier name. In particular "head" is not // allowed. -#define ABSL_OPTION_USE_INLINE_NAMESPACE 1 -#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_y_20211102 +#define Y_ABSL_OPTION_USE_INLINE_NAMESPACE 1 +#define Y_ABSL_OPTION_INLINE_NAMESPACE_NAME lts_y_20211102 -// ABSL_OPTION_HARDENED +// Y_ABSL_OPTION_HARDENED // // This option enables a "hardened" build in release mode (in this context, // release mode is defined as a build where the `NDEBUG` macro is defined). @@ -220,7 +220,7 @@ // Hardened builds have additional security checks enabled when `NDEBUG` is // defined. Defining `NDEBUG` is normally used to turn `assert()` macro into a // no-op, as well as disabling other bespoke program consistency checks. By -// defining ABSL_OPTION_HARDENED to 1, a select set of checks remain enabled in +// defining Y_ABSL_OPTION_HARDENED to 1, a select set of checks remain enabled in // release mode. These checks guard against programming errors that may lead to // security vulnerabilities. In release mode, when one of these programming // errors is encountered, the program will immediately abort, possibly without @@ -229,10 +229,10 @@ // The checks enabled by this option are not free; they do incur runtime cost. // // The checks enabled by this option are always active when `NDEBUG` is not -// defined, even in the case when ABSL_OPTION_HARDENED is defined to 0. The +// defined, even in the case when Y_ABSL_OPTION_HARDENED is defined to 0. The // checks enabled by this option may abort the program in a different way and // log additional information when `NDEBUG` is not defined. -#define ABSL_OPTION_HARDENED 0 +#define Y_ABSL_OPTION_HARDENED 0 -#endif // ABSL_BASE_OPTIONS_H_ +#endif // Y_ABSL_BASE_OPTIONS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/policy_checks.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/policy_checks.h index 06b3243916..77b7dca964 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/policy_checks.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/policy_checks.h @@ -21,8 +21,8 @@ // reported with `#error`. This enforcement is best effort, so successfully // compiling this header does not guarantee a supported configuration. -#ifndef ABSL_BASE_POLICY_CHECKS_H_ -#define ABSL_BASE_POLICY_CHECKS_H_ +#ifndef Y_ABSL_BASE_POLICY_CHECKS_H_ +#define Y_ABSL_BASE_POLICY_CHECKS_H_ // Included for the __GLIBC_PREREQ macro used below. #include <limits.h> @@ -108,4 +108,4 @@ #error "Abseil assumes that int is at least 4 bytes. " #endif -#endif // ABSL_BASE_POLICY_CHECKS_H_ +#endif // Y_ABSL_BASE_POLICY_CHECKS_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/port.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/port.h index 69ec795d46..f627abeb03 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/port.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/port.h @@ -15,11 +15,11 @@ // This files is a forwarding header for other headers containing various // portability macros and functions. -#ifndef ABSL_BASE_PORT_H_ -#define ABSL_BASE_PORT_H_ +#ifndef Y_ABSL_BASE_PORT_H_ +#define Y_ABSL_BASE_PORT_H_ #include "y_absl/base/attributes.h" #include "y_absl/base/config.h" #include "y_absl/base/optimization.h" -#endif // ABSL_BASE_PORT_H_ +#endif // Y_ABSL_BASE_PORT_H_ diff --git a/contrib/restricted/abseil-cpp-tstring/y_absl/base/thread_annotations.h b/contrib/restricted/abseil-cpp-tstring/y_absl/base/thread_annotations.h index aba5d58dc3..25427b419a 100644 --- a/contrib/restricted/abseil-cpp-tstring/y_absl/base/thread_annotations.h +++ b/contrib/restricted/abseil-cpp-tstring/y_absl/base/thread_annotations.h @@ -31,21 +31,21 @@ // you want to refer to is not in scope, you may use a member pointer // (e.g. &MyClass::mutex_) to refer to a mutex in some (unknown) object. -#ifndef ABSL_BASE_THREAD_ANNOTATIONS_H_ -#define ABSL_BASE_THREAD_ANNOTATIONS_H_ +#ifndef Y_ABSL_BASE_THREAD_ANNOTATIONS_H_ +#define Y_ABSL_BASE_THREAD_ANNOTATIONS_H_ #include "y_absl/base/attributes.h" #include "y_absl/base/config.h" // TODO(mbonadei): Remove after the backward compatibility period. #include "y_absl/base/internal/thread_annotations.h" // IWYU pragma: export -// ABSL_GUARDED_BY() +// Y_ABSL_GUARDED_BY() // // Documents if a shared field or global variable needs to be protected by a -// mutex. ABSL_GUARDED_BY() allows the user to specify a particular mutex that +// mutex. Y_ABSL_GUARDED_BY() allows the user to specify a particular mutex that // should be held when accessing the annotated variable. // -// Although this annotation (and ABSL_PT_GUARDED_BY, below) cannot be applied to +// Although this annotation (and Y_ABSL_PT_GUARDED_BY, below) cannot be applied to // local variables, a local variable and its associated mutex can often be // combined into a small class or struct, thereby allowing the annotation. // @@ -53,16 +53,16 @@ // // class Foo { // Mutex mu_; -// int p1_ ABSL_GUARDED_BY(mu_); +// int p1_ Y_ABSL_GUARDED_BY(mu_); // ... // }; -#if ABSL_HAVE_ATTRIBUTE(guarded_by) -#define ABSL_GUARDED_BY(x) __attribute__((guarded_by(x))) +#if Y_ABSL_HAVE_ATTRIBUTE(guarded_by) +#define Y_ABSL_GUARDED_BY(x) __attribute__((guarded_by(x))) #else -#define ABSL_GUARDED_BY(x) +#define Y_ABSL_GUARDED_BY(x) #endif -// ABSL_PT_GUARDED_BY() +// Y_ABSL_PT_GUARDED_BY() // // Documents if the memory location pointed to by a pointer should be guarded // by a mutex when dereferencing the pointer. @@ -70,7 +70,7 @@ // Example: // class Foo { // Mutex mu_; -// int *p1_ ABSL_PT_GUARDED_BY(mu_); +// int *p1_ Y_ABSL_PT_GUARDED_BY(mu_); // ... // }; // @@ -81,41 +81,41 @@ // // // `q_`, guarded by `mu1_`, points to a shared memory location that is // // guarded by `mu2_`: -// int *q_ ABSL_GUARDED_BY(mu1_) ABSL_PT_GUARDED_BY(mu2_); -#if ABSL_HAVE_ATTRIBUTE(pt_guarded_by) -#define ABSL_PT_GUARDED_BY(x) __attribute__((pt_guarded_by(x))) +// int *q_ Y_ABSL_GUARDED_BY(mu1_) Y_ABSL_PT_GUARDED_BY(mu2_); +#if Y_ABSL_HAVE_ATTRIBUTE(pt_guarded_by) +#define Y_ABSL_PT_GUARDED_BY(x) __attribute__((pt_guarded_by(x))) #else -#define ABSL_PT_GUARDED_BY(x) +#define Y_ABSL_PT_GUARDED_BY(x) #endif -// ABSL_ACQUIRED_AFTER() / ABSL_ACQUIRED_BEFORE() +// Y_ABSL_ACQUIRED_AFTER() / Y_ABSL_ACQUIRED_BEFORE() // // Documents the acquisition order between locks that can be held // simultaneously by a thread. For any two locks that need to be annotated // to establish an acquisition order, only one of them needs the annotation. -// (i.e. You don't have to annotate both locks with both ABSL_ACQUIRED_AFTER -// and ABSL_ACQUIRED_BEFORE.) +// (i.e. You don't have to annotate both locks with both Y_ABSL_ACQUIRED_AFTER +// and Y_ABSL_ACQUIRED_BEFORE.) // -// As with ABSL_GUARDED_BY, this is only applicable to mutexes that are shared +// As with Y_ABSL_GUARDED_BY, this is only applicable to mutexes that are shared // fields or global variables. // // Example: // // Mutex m1_; -// Mutex m2_ ABSL_ACQUIRED_AFTER(m1_); -#if ABSL_HAVE_ATTRIBUTE(acquired_after) -#define ABSL_ACQUIRED_AFTER(...) __attribute__((acquired_after(__VA_ARGS__))) +// Mutex m2_ Y_ABSL_ACQUIRED_AFTER(m1_); +#if Y_ABSL_HAVE_ATTRIBUTE(acquired_after) +#define Y_ABSL_ACQUIRED_AFTER(...) __attribute__((acquired_after(__VA_ARGS__))) #else -#define ABSL_ACQUIRED_AFTER(...) +#define Y_ABSL_ACQUIRED_AFTER(...) #endif -#if ABSL_HAVE_ATTRIBUTE(acquired_before) -#define ABSL_ACQUIRED_BEFORE(...) __attribute__((acquired_before(__VA_ARGS__))) +#if Y_ABSL_HAVE_ATTRIBUTE(acquired_before) +#define Y_ABSL_ACQUIRED_BEFORE(...) __attribute__((acquired_before(__VA_ARGS__))) #else -#define ABSL_ACQUIRED_BEFORE(...) +#define Y_ABSL_ACQUIRED_BEFORE(...) #endif -// ABSL_EXCLUSIVE_LOCKS_REQUIRED() / ABSL_SHARED_LOCKS_REQUIRED() +// Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED() / Y_ABSL_SHARED_LOCKS_REQUIRED() // // Documents a function that expects a mutex to be held prior to entry. // The mutex is expected to be held both on entry to, and exit from, the @@ -127,108 +127,108 @@ // concurrently. // // Generally, non-const methods should be annotated with -// ABSL_EXCLUSIVE_LOCKS_REQUIRED, while const methods should be annotated with -// ABSL_SHARED_LOCKS_REQUIRED. +// Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED, while const methods should be annotated with +// Y_ABSL_SHARED_LOCKS_REQUIRED. // // Example: // // Mutex mu1, mu2; -// int a ABSL_GUARDED_BY(mu1); -// int b ABSL_GUARDED_BY(mu2); +// int a Y_ABSL_GUARDED_BY(mu1); +// int b Y_ABSL_GUARDED_BY(mu2); // -// void foo() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu1, mu2) { ... } -// void bar() const ABSL_SHARED_LOCKS_REQUIRED(mu1, mu2) { ... } -#if ABSL_HAVE_ATTRIBUTE(exclusive_locks_required) -#define ABSL_EXCLUSIVE_LOCKS_REQUIRED(...) \ +// void foo() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu1, mu2) { ... } +// void bar() const Y_ABSL_SHARED_LOCKS_REQUIRED(mu1, mu2) { ... } +#if Y_ABSL_HAVE_ATTRIBUTE(exclusive_locks_required) +#define Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(...) \ __attribute__((exclusive_locks_required(__VA_ARGS__))) #else -#define ABSL_EXCLUSIVE_LOCKS_REQUIRED(...) +#define Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(...) #endif -#if ABSL_HAVE_ATTRIBUTE(shared_locks_required) -#define ABSL_SHARED_LOCKS_REQUIRED(...) \ +#if Y_ABSL_HAVE_ATTRIBUTE(shared_locks_required) +#define Y_ABSL_SHARED_LOCKS_REQUIRED(...) \ __attribute__((shared_locks_required(__VA_ARGS__))) #else -#define ABSL_SHARED_LOCKS_REQUIRED(...) +#define Y_ABSL_SHARED_LOCKS_REQUIRED(...) #endif -// ABSL_LOCKS_EXCLUDED() +// Y_ABSL_LOCKS_EXCLUDED() // // Documents the locks acquired in the body of the function. These locks // cannot be held when calling this function (as Abseil's `Mutex` locks are // non-reentrant). -#if ABSL_HAVE_ATTRIBUTE(locks_excluded) -#define ABSL_LOCKS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__))) +#if Y_ABSL_HAVE_ATTRIBUTE(locks_excluded) +#define Y_ABSL_LOCKS_EXCLUDED(...) __attribute__((locks_excluded(__VA_ARGS__))) #else -#define ABSL_LOCKS_EXCLUDED(...) +#define Y_ABSL_LOCKS_EXCLUDED(...) #endif -// ABSL_LOCK_RETURNED() +// Y_ABSL_LOCK_RETURNED() // // Documents a function that returns a mutex without acquiring it. For example, // a public getter method that returns a pointer to a private mutex should -// be annotated with ABSL_LOCK_RETURNED. -#if ABSL_HAVE_ATTRIBUTE(lock_returned) -#define ABSL_LOCK_RETURNED(x) __attribute__((lock_returned(x))) +// be annotated with Y_ABSL_LOCK_RETURNED. +#if Y_ABSL_HAVE_ATTRIBUTE(lock_returned) +#define Y_ABSL_LOCK_RETURNED(x) __attribute__((lock_returned(x))) #else -#define ABSL_LOCK_RETURNED(x) +#define Y_ABSL_LOCK_RETURNED(x) #endif -// ABSL_LOCKABLE +// Y_ABSL_LOCKABLE // // Documents if a class/type is a lockable type (such as the `Mutex` class). -#if ABSL_HAVE_ATTRIBUTE(lockable) -#define ABSL_LOCKABLE __attribute__((lockable)) +#if Y_ABSL_HAVE_ATTRIBUTE(lockable) +#define Y_ABSL_LOCKABLE __attribute__((lockable)) #else -#define ABSL_LOCKABLE +#define Y_ABSL_LOCKABLE #endif -// ABSL_SCOPED_LOCKABLE +// Y_ABSL_SCOPED_LOCKABLE // // Documents if a class does RAII locking (such as the `MutexLock` class). // The constructor should use `LOCK_FUNCTION()` to specify the mutex that is // acquired, and the destructor should use `UNLOCK_FUNCTION()` with no // arguments; the analysis will assume that the destructor unlocks whatever the // constructor locked. -#if ABSL_HAVE_ATTRIBUTE(scoped_lockable) -#define ABSL_SCOPED_LOCKABLE __attribute__((scoped_lockable)) +#if Y_ABSL_HAVE_ATTRIBUTE(scoped_lockable) +#define Y_ABSL_SCOPED_LOCKABLE __attribute__((scoped_lockable)) #else -#define ABSL_SCOPED_LOCKABLE +#define Y_ABSL_SCOPED_LOCKABLE #endif -// ABSL_EXCLUSIVE_LOCK_FUNCTION() +// Y_ABSL_EXCLUSIVE_LOCK_FUNCTION() // // Documents functions that acquire a lock in the body of a function, and do // not release it. -#if ABSL_HAVE_ATTRIBUTE(exclusive_lock_function) -#define ABSL_EXCLUSIVE_LOCK_FUNCTION(...) \ +#if Y_ABSL_HAVE_ATTRIBUTE(exclusive_lock_function) +#define Y_ABSL_EXCLUSIVE_LOCK_FUNCTION(...) \ __attribute__((exclusive_lock_function(__VA_ARGS__))) #else -#define ABSL_EXCLUSIVE_LOCK_FUNCTION(...) +#define Y_ABSL_EXCLUSIVE_LOCK_FUNCTION(...) #endif -// ABSL_SHARED_LOCK_FUNCTION() +// Y_ABSL_SHARED_LOCK_FUNCTION() // // Documents functions that acquire a shared (reader) lock in the body of a // function, and do not release it. -#if ABSL_HAVE_ATTRIBUTE(shared_lock_function) -#define ABSL_SHARED_LOCK_FUNCTION(...) \ +#if Y_ABSL_HAVE_ATTRIBUTE(shared_lock_function) +#define Y_ABSL_SHARED_LOCK_FUNCTION(...) \ __attribute__((shared_lock_function(__VA_ARGS__))) #else -#define ABSL_SHARED_LOCK_FUNCTION(...) +#define Y_ABSL_SHARED_LOCK_FUNCTION(...) #endif -// ABSL_UNLOCK_FUNCTION() +// Y_ABSL_UNLOCK_FUNCTION() // // Documents functions that expect a lock to be held on entry to the function, // and release it in the body of the function. -#if ABSL_HAVE_ATTRIBUTE(unlock_function) -#define ABSL_UNLOCK_FUNCTION(...) __attribute__((unlock_function(__VA_ARGS__))) +#if Y_ABSL_HAVE_ATTRIBUTE(unlock_function) +#define Y_ABSL_UNLOCK_FUNCTION(...) __attribute__((unlock_function(__VA_ARGS__))) #else -#define ABSL_UNLOCK_FUNCTION(...) +#define Y_ABSL_UNLOCK_FUNCTION(...) #endif -// ABSL_EXCLUSIVE_TRYLOCK_FUNCTION() / ABSL_SHARED_TRYLOCK_FUNCTION() +// Y_ABSL_EXCLUSIVE_TRYLOCK_FUNCTION() / Y_ABSL_SHARED_TRYLOCK_FUNCTION() // // Documents functions that try to acquire a lock, and return success or failure // (or a non-boolean value that can be interpreted as a boolean). @@ -236,100 +236,100 @@ // success, or `false` for functions that return `false` on success. The second // argument specifies the mutex that is locked on success. If unspecified, this // mutex is assumed to be `this`. -#if ABSL_HAVE_ATTRIBUTE(exclusive_trylock_function) -#define ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(...) \ +#if Y_ABSL_HAVE_ATTRIBUTE(exclusive_trylock_function) +#define Y_ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(...) \ __attribute__((exclusive_trylock_function(__VA_ARGS__))) #else -#define ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(...) +#define Y_ABSL_EXCLUSIVE_TRYLOCK_FUNCTION(...) #endif -#if ABSL_HAVE_ATTRIBUTE(shared_trylock_function) -#define ABSL_SHARED_TRYLOCK_FUNCTION(...) \ +#if Y_ABSL_HAVE_ATTRIBUTE(shared_trylock_function) +#define Y_ABSL_SHARED_TRYLOCK_FUNCTION(...) \ __attribute__((shared_trylock_function(__VA_ARGS__))) #else -#define ABSL_SHARED_TRYLOCK_FUNCTION(...) +#define Y_ABSL_SHARED_TRYLOCK_FUNCTION(...) #endif -// ABSL_ASSERT_EXCLUSIVE_LOCK() / ABSL_ASSERT_SHARED_LOCK() +// Y_ABSL_ASSERT_EXCLUSIVE_LOCK() / Y_ABSL_ASSERT_SHARED_LOCK() // // Documents functions that dynamically check to see if a lock is held, and fail // if it is not held. -#if ABSL_HAVE_ATTRIBUTE(assert_exclusive_lock) -#define ABSL_ASSERT_EXCLUSIVE_LOCK(...) \ +#if Y_ABSL_HAVE_ATTRIBUTE(assert_exclusive_lock) +#define Y_ABSL_ASSERT_EXCLUSIVE_LOCK(...) \ __attribute__((assert_exclusive_lock(__VA_ARGS__))) #else -#define ABSL_ASSERT_EXCLUSIVE_LOCK(...) +#define Y_ABSL_ASSERT_EXCLUSIVE_LOCK(...) #endif -#if ABSL_HAVE_ATTRIBUTE(assert_shared_lock) -#define ABSL_ASSERT_SHARED_LOCK(...) \ +#if Y_ABSL_HAVE_ATTRIBUTE(assert_shared_lock) +#define Y_ABSL_ASSERT_SHARED_LOCK(...) \ __attribute__((assert_shared_lock(__VA_ARGS__))) #else -#define ABSL_ASSERT_SHARED_LOCK(...) +#define Y_ABSL_ASSERT_SHARED_LOCK(...) #endif -// ABSL_NO_THREAD_SAFETY_ANALYSIS +// Y_ABSL_NO_THREAD_SAFETY_ANALYSIS // // Turns off thread safety checking within the body of a particular function. // This annotation is used to mark functions that are known to be correct, but // the locking behavior is more complicated than the analyzer can handle. -#if ABSL_HAVE_ATTRIBUTE(no_thread_safety_analysis) -#define ABSL_NO_THREAD_SAFETY_ANALYSIS \ +#if Y_ABSL_HAVE_ATTRIBUTE(no_thread_safety_analysis) +#define Y_ABSL_NO_THREAD_SAFETY_ANALYSIS \ __attribute__((no_thread_safety_analysis)) #else -#define ABSL_NO_THREAD_SAFETY_ANALYSIS +#define Y_ABSL_NO_THREAD_SAFETY_ANALYSIS #endif //------------------------------------------------------------------------------ // Tool-Supplied Annotations //------------------------------------------------------------------------------ -// ABSL_TS_UNCHECKED should be placed around lock expressions that are not valid +// Y_ABSL_TS_UNCHECKED should be placed around lock expressions that are not valid // C++ syntax, but which are present for documentation purposes. These // annotations will be ignored by the analysis. -#define ABSL_TS_UNCHECKED(x) "" +#define Y_ABSL_TS_UNCHECKED(x) "" -// ABSL_TS_FIXME is used to mark lock expressions that are not valid C++ syntax. +// Y_ABSL_TS_FIXME is used to mark lock expressions that are not valid C++ syntax. // It is used by automated tools to mark and disable invalid expressions. -// The annotation should either be fixed, or changed to ABSL_TS_UNCHECKED. -#define ABSL_TS_FIXME(x) "" +// The annotation should either be fixed, or changed to Y_ABSL_TS_UNCHECKED. +#define Y_ABSL_TS_FIXME(x) "" -// Like ABSL_NO_THREAD_SAFETY_ANALYSIS, this turns off checking within the body +// Like Y_ABSL_NO_THREAD_SAFETY_ANALYSIS, this turns off checking within the body // of a particular function. However, this attribute is used to mark functions // that are incorrect and need to be fixed. It is used by automated tools to // avoid breaking the build when the analysis is updated. // Code owners are expected to eventually fix the routine. -#define ABSL_NO_THREAD_SAFETY_ANALYSIS_FIXME ABSL_NO_THREAD_SAFETY_ANALYSIS +#define Y_ABSL_NO_THREAD_SAFETY_ANALYSIS_FIXME Y_ABSL_NO_THREAD_SAFETY_ANALYSIS -// Similar to ABSL_NO_THREAD_SAFETY_ANALYSIS_FIXME, this macro marks a -// ABSL_GUARDED_BY annotation that needs to be fixed, because it is producing -// thread safety warning. It disables the ABSL_GUARDED_BY. -#define ABSL_GUARDED_BY_FIXME(x) +// Similar to Y_ABSL_NO_THREAD_SAFETY_ANALYSIS_FIXME, this macro marks a +// Y_ABSL_GUARDED_BY annotation that needs to be fixed, because it is producing +// thread safety warning. It disables the Y_ABSL_GUARDED_BY. +#define Y_ABSL_GUARDED_BY_FIXME(x) // Disables warnings for a single read operation. This can be used to avoid // warnings when it is known that the read is not actually involved in a race, // but the compiler cannot confirm that. -#define ABSL_TS_UNCHECKED_READ(x) y_absl::base_internal::ts_unchecked_read(x) +#define Y_ABSL_TS_UNCHECKED_READ(x) y_absl::base_internal::y_ts_unchecked_read(x) namespace y_absl { -ABSL_NAMESPACE_BEGIN +Y_ABSL_NAMESPACE_BEGIN namespace base_internal { // Takes a reference to a guarded data member, and returns an unguarded // reference. -// Do not use this function directly, use ABSL_TS_UNCHECKED_READ instead. +// Do not use this function directly, use Y_ABSL_TS_UNCHECKED_READ instead. template <typename T> -inline const T& ts_unchecked_read(const T& v) ABSL_NO_THREAD_SAFETY_ANALYSIS { +inline const T& y_ts_unchecked_read(const T& v) Y_ABSL_NO_THREAD_SAFETY_ANALYSIS { return v; } template <typename T> -inline T& ts_unchecked_read(T& v) ABSL_NO_THREAD_SAFETY_ANALYSIS { +inline T& y_ts_unchecked_read(T& v) Y_ABSL_NO_THREAD_SAFETY_ANALYSIS { return v; } } // namespace base_internal -ABSL_NAMESPACE_END +Y_ABSL_NAMESPACE_END } // namespace y_absl -#endif // ABSL_BASE_THREAD_ANNOTATIONS_H_ +#endif // Y_ABSL_BASE_THREAD_ANNOTATIONS_H_ |