mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Threading][TSan] Fix builds where TSan isn't supported.
On builds where TSan isn't supported, don't include any code in ThreadSanitizer.cpp. rdar://110665213
This commit is contained in:
@@ -25,6 +25,9 @@
|
||||
namespace swift {
|
||||
|
||||
#if defined(_WIN32) || defined(__wasi__) || !__has_include(<dlfcn.h>)
|
||||
|
||||
#define SWIFT_THREADING_TSAN_SUPPORT 0
|
||||
|
||||
namespace tsan {
|
||||
|
||||
inline bool enabled() { return false; }
|
||||
@@ -34,6 +37,8 @@ template <typename T> T *release(T *ptr) { return ptr; }
|
||||
} // namespace tsan
|
||||
#else
|
||||
|
||||
#define SWIFT_THREADING_TSAN_SUPPORT 1
|
||||
|
||||
// If we're static linking to libswiftThreading.a, these symbols can come
|
||||
// from there. If, on the other hand, we're dynamically linked, we want
|
||||
// to get them from libswiftCore.dylib instead.
|
||||
|
||||
Reference in New Issue
Block a user