-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests: протестировано CI Pull Request resolved: #105 Co-authored-by: Antony Polukhin <antoshkka@gmail.com>
- Loading branch information
Showing
9 changed files
with
124 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
/// @file userver/compiler/impl/tsan.hpp | ||
/// @brief Defines USERVER_IMPL_HAS_TSAN to 1 and includes | ||
/// <sanitizer/tsan_interface.h> if Thread Sanitizer is enabled; otherwise | ||
/// defines USERVER_IMPL_HAS_TSAN to 0. | ||
|
||
#if defined(__has_feature) | ||
|
||
#if __has_feature(thread_sanitizer) | ||
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) | ||
#define USERVER_IMPL_HAS_TSAN 1 | ||
#else | ||
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) | ||
#define USERVER_IMPL_HAS_TSAN 0 | ||
#endif | ||
|
||
#else | ||
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) | ||
#define USERVER_IMPL_HAS_TSAN 0 | ||
#endif | ||
|
||
#if USERVER_IMPL_HAS_TSAN | ||
#include <sanitizer/tsan_interface.h> | ||
#endif | ||
|
||
#if USERVER_IMPL_HAS_TSAN && !defined(BOOST_USE_TSAN) | ||
#error Broken CMake: thread sanitizer is used however Boost is unaware of it | ||
#endif | ||
|
||
#if !USERVER_IMPL_HAS_TSAN && defined(BOOST_USE_TSAN) | ||
#error Broken CMake: thread sanitizer is not used however Boost thinks it is | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters