diff options
Diffstat (limited to 'absl/strings/internal/cordz_functions.h')
-rw-r--r-- | absl/strings/internal/cordz_functions.h | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/absl/strings/internal/cordz_functions.h b/absl/strings/internal/cordz_functions.h index 93f46ec6..ed108bf1 100644 --- a/absl/strings/internal/cordz_functions.h +++ b/absl/strings/internal/cordz_functions.h @@ -32,18 +32,10 @@ int32_t get_cordz_mean_interval(); // Sets the sample rate with the average interval between samples. void set_cordz_mean_interval(int32_t mean_interval); -// Enable cordz unless any of the following applies: -// - no thread local support -// - MSVC build -// - Android build -// - Apple build -// - DLL build -// Hashtablez is turned off completely in opensource builds. -// MSVC's static atomics are dynamically initialized in debug mode, which breaks -// sampling. -#if defined(ABSL_HAVE_THREAD_LOCAL) && !defined(_MSC_VER) && \ - !defined(ABSL_BUILD_DLL) && !defined(ABSL_CONSUME_DLL) && \ - !defined(__ANDROID__) && !defined(__APPLE__) +// Cordz is only enabled on Linux with thread_local support. +#if defined(ABSL_INTERNAL_CORDZ_ENABLED) +#error ABSL_INTERNAL_CORDZ_ENABLED cannot be set directly +#elif defined(__linux__) && defined(ABSL_HAVE_THREAD_LOCAL) #define ABSL_INTERNAL_CORDZ_ENABLED 1 #endif |