Removes the legacy spellings of the thread annotation macros/functions

by default.

The compatibility macro `ABSL_LEGACY_THREAD_ANNOTATIONS` can be
defined on the compile command-line to temporarily restore these
spellings. All of the thread annotation macros are available under
ABSL_ prefixed spellings in `absl/base/thread_annotations.h`. The
compatibility macro and the legacy spellings will be removed in the
future.

See https://github.com/google/fuzztest/issues/41

PiperOrigin-RevId: 478498273
Change-Id: I120ad6480d031642bf95a11bf72ab883d9161810
pull/1287/head
Derek Mauro 2 years ago committed by Copybara-Service
parent 7f3c0d7811
commit 6acb60c161
  1. 9
      absl/base/internal/thread_annotations.h

@ -38,6 +38,13 @@
#ifndef ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_
#define ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_
// ABSL_LEGACY_THREAD_ANNOTATIONS is a *temporary* compatibility macro that can
// be defined on the compile command-line to restore the legacy spellings of the
// thread annotations macros/functions. The macros in this file are available
// under ABSL_ prefixed spellings in absl/base/thread_annotations.h. This macro
// and the legacy spellings will be removed in the future.
#ifdef ABSL_LEGACY_THREAD_ANNOTATIONS
#if defined(__clang__)
#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
#else
@ -268,4 +275,6 @@ inline T& ts_unchecked_read(T& v) NO_THREAD_SAFETY_ANALYSIS {
} // namespace thread_safety_analysis
#endif // defined(ABSL_LEGACY_THREAD_ANNOTATIONS)
#endif // ABSL_BASE_INTERNAL_THREAD_ANNOTATIONS_H_

Loading…
Cancel
Save