diff options
Diffstat (limited to 'Firestore/third_party/abseil-cpp/absl/base')
-rw-r--r-- | Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt | 64 | ||||
-rw-r--r-- | Firestore/third_party/abseil-cpp/absl/base/attributes.h | 15 | ||||
-rw-r--r-- | Firestore/third_party/abseil-cpp/absl/base/config.h | 41 | ||||
-rw-r--r-- | Firestore/third_party/abseil-cpp/absl/base/internal/endian.h | 2 | ||||
-rw-r--r-- | Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.cc | 7 | ||||
-rw-r--r-- | Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.h | 2 | ||||
-rw-r--r-- | Firestore/third_party/abseil-cpp/absl/base/internal/unaligned_access.h | 2 | ||||
-rw-r--r-- | Firestore/third_party/abseil-cpp/absl/base/log_severity.h (renamed from Firestore/third_party/abseil-cpp/absl/base/internal/log_severity.h) | 11 | ||||
-rw-r--r-- | Firestore/third_party/abseil-cpp/absl/base/macros.h | 2 |
9 files changed, 117 insertions, 29 deletions
diff --git a/Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt b/Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt index 3e94d51..4b7b53a 100644 --- a/Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt +++ b/Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt @@ -20,6 +20,7 @@ list(APPEND BASE_PUBLIC_HEADERS "casts.h" "config.h" "dynamic_annotations.h" + "log_severity.h" "macros.h" "optimization.h" "policy_checks.h" @@ -33,17 +34,18 @@ list(APPEND BASE_INTERNAL_HEADERS "internal/cycleclock.h" "internal/endian.h" "internal/exception_testing.h" + "internal/exception_safety_testing.h" "internal/identity.h" "internal/invoke.h" - "internal/log_severity.h" + "internal/inline_variable.h" "internal/low_level_alloc.h" "internal/low_level_scheduling.h" - "internal/malloc_extension_c.h" "internal/malloc_extension.h" "internal/malloc_hook_c.h" "internal/malloc_hook.h" "internal/malloc_hook_invoke.h" "internal/per_thread_tls.h" + "internal/pretty_function.h" "internal/raw_logging.h" "internal/scheduling_mode.h" "internal/spinlock.h" @@ -58,7 +60,7 @@ list(APPEND BASE_INTERNAL_HEADERS # absl_base main library -list(APPEND BASE_SRC +list(APPEND BASE_SRC "internal/cycleclock.cc" "internal/raw_logging.cc" "internal/spinlock.cc" @@ -114,6 +116,28 @@ absl_library( throw_delegate ) +if(BUILD_TESTING) + # exception-safety testing library + set(EXCEPTION_SAFETY_TESTING_SRC "internal/exception_safety_testing.cc") + set(EXCEPTION_SAFETY_TESTING_PUBLIC_LIBRARIES + ${ABSL_TEST_COMMON_LIBRARIES} + absl::base + absl::memory + absl::meta + absl::strings + absl::types + ) + +absl_library( + TARGET + absl_base_internal_exception_safety_testing + SOURCES + ${EXCEPTION_SAFETY_TESTING_SRC} + PUBLIC_LIBRARIES + ${EXCEPTION_SAFETY_TESTING_PUBLIC_LIBRARIES} +) +endif() + # dynamic_annotations library set(DYNAMIC_ANNOTATIONS_SRC "dynamic_annotations.cc") @@ -212,6 +236,26 @@ absl_test( ) +# test inline_variable_test +list(APPEND INLINE_VARIABLE_TEST_SRC + "internal/inline_variable_testing.h" + "inline_variable_test.cc" + "inline_variable_test_a.cc" + "inline_variable_test_b.cc" +) + +set(INLINE_VARIABLE_TEST_PUBLIC_LIBRARIES absl::base) + +absl_test( + TARGET + inline_variable_test + SOURCES + ${INLINE_VARIABLE_TEST_SRC} + PUBLIC_LIBRARIES + ${INLINE_VARIABLE_TEST_PUBLIC_LIBRARIES} +) + + # test spinlock_test_common set(SPINLOCK_TEST_COMMON_SRC "spinlock_test_common.cc") set(SPINLOCK_TEST_COMMON_PUBLIC_LIBRARIES absl::base absl::synchronization) @@ -319,6 +363,20 @@ absl_test( ${THREAD_IDENTITY_TEST_PUBLIC_LIBRARIES} ) +#test exceptions_safety_testing_test +set(EXCEPTION_SAFETY_TESTING_TEST_SRC "exception_safety_testing_test.cc") +set(EXCEPTION_SAFETY_TESTING_TEST_PUBLIC_LIBRARIES absl::base absl::memory absl::meta absl::strings absl::optional) + +absl_test( + TARGET + absl_exception_safety_testing_test + SOURCES + ${EXCEPTION_SAFETY_TESTING_TEST_SRC} + PUBLIC_LIBRARIES + ${EXCEPTION_SAFETY_TESTING_TEST_PUBLIC_LIBRARIES} + PRIVATE_COMPILE_FLAGS + ${ABSL_EXCEPTIONS_FLAG} +) # test absl_malloc_extension_system_malloc_test set(MALLOC_EXTENSION_SYSTEM_MALLOC_TEST_SRC "internal/malloc_extension_test.cc") diff --git a/Firestore/third_party/abseil-cpp/absl/base/attributes.h b/Firestore/third_party/abseil-cpp/absl/base/attributes.h index 6f3cfe4..4e1fc8b 100644 --- a/Firestore/third_party/abseil-cpp/absl/base/attributes.h +++ b/Firestore/third_party/abseil-cpp/absl/base/attributes.h @@ -281,6 +281,18 @@ #define ABSL_ATTRIBUTE_NO_SANITIZE_CFI #endif +// ABSL_ATTRIBUTE_RETURNS_NONNULL +// +// Tells the compiler that a particular function never returns a null pointer. +#if ABSL_HAVE_ATTRIBUTE(returns_nonnull) || \ + (defined(__GNUC__) && \ + (__GNUC__ > 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) && \ + !defined(__clang__)) +#define ABSL_ATTRIBUTE_RETURNS_NONNULL __attribute__((returns_nonnull)) +#else +#define ABSL_ATTRIBUTE_RETURNS_NONNULL +#endif + // ABSL_HAVE_ATTRIBUTE_SECTION // // Indicates whether labeled sections are supported. Labeled sections are not @@ -305,6 +317,7 @@ __attribute__((section(#name))) __attribute__((noinline)) #endif + // ABSL_ATTRIBUTE_SECTION_VARIABLE // // Tells the compiler/linker to put a given variable into a section and define @@ -344,6 +357,7 @@ (reinterpret_cast<void *>(__start_##name)) #define ABSL_ATTRIBUTE_SECTION_STOP(name) \ (reinterpret_cast<void *>(__stop_##name)) + #else // !ABSL_HAVE_ATTRIBUTE_SECTION #define ABSL_HAVE_ATTRIBUTE_SECTION 0 @@ -356,6 +370,7 @@ #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)) + #endif // ABSL_ATTRIBUTE_SECTION // ABSL_ATTRIBUTE_STACK_ALIGN_FOR_OLD_LIBC diff --git a/Firestore/third_party/abseil-cpp/absl/base/config.h b/Firestore/third_party/abseil-cpp/absl/base/config.h index 8a44c06..6703d0e 100644 --- a/Firestore/third_party/abseil-cpp/absl/base/config.h +++ b/Firestore/third_party/abseil-cpp/absl/base/config.h @@ -138,9 +138,10 @@ // supported. #ifdef ABSL_HAVE_THREAD_LOCAL #error ABSL_HAVE_THREAD_LOCAL cannot be directly set -#elif !defined(__apple_build_version__) || \ - ((__apple_build_version__ >= 8000042) && \ - !(TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0)) +#elif (!defined(__apple_build_version__) || \ + (__apple_build_version__ >= 8000042)) && \ + !(defined(__APPLE__) && TARGET_OS_IPHONE && \ + __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0) // Notes: Xcode's clang did not support `thread_local` until version // 8, and even then not for all iOS < 9.0. #define ABSL_HAVE_THREAD_LOCAL 1 @@ -181,21 +182,21 @@ // __SIZEOF_INT128__ but not all versions actually support __int128. #ifdef ABSL_HAVE_INTRINSIC_INT128 #error ABSL_HAVE_INTRINSIC_INT128 cannot be directly set -#elif (defined(__clang__) && defined(__SIZEOF_INT128__) && \ - !defined(__aarch64__)) || \ - (defined(__CUDACC__) && defined(__SIZEOF_INT128__) && \ - __CUDACC_VER_MAJOR__ >= 9) || \ - (!defined(__clang__) && !defined(__CUDACC__) && defined(__GNUC__) && \ - defined(__SIZEOF_INT128__)) +#elif defined(__SIZEOF_INT128__) +#if (defined(__clang__) && !defined(__aarch64__)) || \ + (defined(__CUDACC__) && __CUDACC_VER_MAJOR__ >= 9) || \ + (!defined(__clang__) && !defined(__CUDACC__) && defined(__GNUC__)) #define ABSL_HAVE_INTRINSIC_INT128 1 +#elif defined(__CUDACC__) // __CUDACC_VER__ is a full version number before CUDA 9, and is defined to a -// std::string explaining that it has been removed starting with CUDA 9. We can't -// compare both variants in a single boolean expression because there is no -// short-circuiting in the preprocessor. -#elif defined(__CUDACC__) && defined(__SIZEOF_INT128__) && \ - __CUDACC_VER__ >= 7000 +// std::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 -#endif +#endif // __CUDACC_VER__ >= 70000 +#endif // defined(__CUDACC__) +#endif // ABSL_HAVE_INTRINSIC_INT128 // ABSL_HAVE_EXCEPTIONS // @@ -243,7 +244,7 @@ // Windows _WIN32 // NaCL __native_client__ // AsmJS __asmjs__ -// Fuschia __Fuchsia__ +// Fuchsia __Fuchsia__ // // Note that since Android defines both __ANDROID__ and __linux__, one // may probe for either Linux or Android by simply testing for __linux__. @@ -254,8 +255,9 @@ // POSIX.1-2001. #ifdef ABSL_HAVE_MMAP #error ABSL_HAVE_MMAP cannot be directly set -#elif defined(__linux__) || defined(__APPLE__) || defined(__ros__) || \ - defined(__native_client__) || defined(__asmjs__) || defined(__Fuchsia__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ + defined(__ros__) || defined(__native_client__) || defined(__asmjs__) || \ + defined(__Fuchsia__) #define ABSL_HAVE_MMAP 1 #endif @@ -265,7 +267,8 @@ // functions as defined in POSIX.1-2001. #ifdef ABSL_HAVE_PTHREAD_GETSCHEDPARAM #error ABSL_HAVE_PTHREAD_GETSCHEDPARAM cannot be directly set -#elif defined(__linux__) || defined(__APPLE__) || defined(__ros__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ + defined(__ros__) #define ABSL_HAVE_PTHREAD_GETSCHEDPARAM 1 #endif diff --git a/Firestore/third_party/abseil-cpp/absl/base/internal/endian.h b/Firestore/third_party/abseil-cpp/absl/base/internal/endian.h index 602129e..edc10f1 100644 --- a/Firestore/third_party/abseil-cpp/absl/base/internal/endian.h +++ b/Firestore/third_party/abseil-cpp/absl/base/internal/endian.h @@ -22,6 +22,8 @@ #elif defined(__APPLE__) // Mac OS X / Darwin features #include <libkern/OSByteOrder.h> +#elif defined(__FreeBSD__) +#include <sys/endian.h> #elif defined(__GLIBC__) #include <byteswap.h> // IWYU pragma: export #endif diff --git a/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.cc b/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.cc index 1b849ab..86e34d4 100644 --- a/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.cc +++ b/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.cc @@ -22,7 +22,7 @@ #include "absl/base/config.h" #include "absl/base/internal/atomic_hook.h" -#include "absl/base/internal/log_severity.h" +#include "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. @@ -34,7 +34,8 @@ // // This preprocessor token is also defined in raw_io.cc. If you need to copy // this, consider moving both to config.h instead. -#if defined(__linux__) || defined(__APPLE__) || defined(__Fuchsia__) +#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ + defined(__Fuchsia__) #include <unistd.h> @@ -47,7 +48,7 @@ // 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(__ANDROID__) +#if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__) #include <sys/syscall.h> #define ABSL_HAVE_SYSCALL_WRITE 1 #define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1 diff --git a/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.h b/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.h index 568d2af..1b2a44b 100644 --- a/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.h +++ b/Firestore/third_party/abseil-cpp/absl/base/internal/raw_logging.h @@ -20,7 +20,7 @@ #define ABSL_BASE_INTERNAL_RAW_LOGGING_H_ #include "absl/base/attributes.h" -#include "absl/base/internal/log_severity.h" +#include "absl/base/log_severity.h" #include "absl/base/macros.h" #include "absl/base/port.h" diff --git a/Firestore/third_party/abseil-cpp/absl/base/internal/unaligned_access.h b/Firestore/third_party/abseil-cpp/absl/base/internal/unaligned_access.h index ea30829..c572436 100644 --- a/Firestore/third_party/abseil-cpp/absl/base/internal/unaligned_access.h +++ b/Firestore/third_party/abseil-cpp/absl/base/internal/unaligned_access.h @@ -142,7 +142,7 @@ inline void UnalignedStore64(void *p, uint64_t v) { // and 32-bit values (not 64-bit); older versions either raise a fatal signal, // do an unaligned read and rotate the words around a bit, or do the reads very // slowly (trip through kernel mode). There's no simple #define that says just -// “ARMv7 or higher”, so we have to filter away all ARMv5 and ARMv6 +// "ARMv7 or higher", so we have to filter away all ARMv5 and ARMv6 // sub-architectures. Newer gcc (>= 4.6) set an __ARM_FEATURE_ALIGNED #define, // so in time, maybe we can move on to that. // diff --git a/Firestore/third_party/abseil-cpp/absl/base/internal/log_severity.h b/Firestore/third_party/abseil-cpp/absl/base/log_severity.h index deaf6a5..e146bcb 100644 --- a/Firestore/third_party/abseil-cpp/absl/base/internal/log_severity.h +++ b/Firestore/third_party/abseil-cpp/absl/base/log_severity.h @@ -16,6 +16,8 @@ #ifndef ABSL_BASE_INTERNAL_LOG_SEVERITY_H_ #define ABSL_BASE_INTERNAL_LOG_SEVERITY_H_ +#include <array> + #include "absl/base/attributes.h" namespace absl { @@ -27,6 +29,13 @@ enum class LogSeverity : int { kFatal = 3, }; +// Returns an iterable of all standard `absl::LogSeverity` values, ordered from +// least to most severe. +constexpr std::array<absl::LogSeverity, 4> LogSeverities() { + return {{absl::LogSeverity::kInfo, absl::LogSeverity::kWarning, + absl::LogSeverity::kError, absl::LogSeverity::kFatal}}; +} + constexpr const char* LogSeverityName(absl::LogSeverity s) { return s == absl::LogSeverity::kInfo ? "INFO" @@ -37,7 +46,7 @@ constexpr const char* LogSeverityName(absl::LogSeverity s) { : s == absl::LogSeverity::kFatal ? "FATAL" : "UNKNOWN"; } -// Note that out-of-range large severities normalize to kError, not kFatal. +// Note that out-of-range severities normalize to kInfo or kError, never kFatal. constexpr absl::LogSeverity NormalizeLogSeverity(absl::LogSeverity s) { return s < absl::LogSeverity::kInfo ? absl::LogSeverity::kInfo diff --git a/Firestore/third_party/abseil-cpp/absl/base/macros.h b/Firestore/third_party/abseil-cpp/absl/base/macros.h index d414087..5ae0f05 100644 --- a/Firestore/third_party/abseil-cpp/absl/base/macros.h +++ b/Firestore/third_party/abseil-cpp/absl/base/macros.h @@ -146,7 +146,7 @@ enum LinkerInitialized { // 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__) && __cplusplus >= 201103L && defined(__has_warning) +#if defined(__clang__) && __cplusplus >= 201103L #define ABSL_DEPRECATED(message) __attribute__((deprecated(message))) #endif |