Skip to content

Commit

Permalink
Removes the legacy spellings of the thread annotation macros/functions
Browse files Browse the repository at this point in the history
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 google/fuzztest#41

PiperOrigin-RevId: 478498273
Change-Id: I120ad6480d031642bf95a11bf72ab883d9161810
  • Loading branch information
derekmauro authored and Copybara-Service committed Oct 3, 2022
1 parent 7f3c0d7 commit 6acb60c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions absl/base/internal/thread_annotations.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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_

0 comments on commit 6acb60c

Please sign in to comment.