summaryrefslogtreecommitdiffstats
path: root/Include/pyport.h
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-04-10 14:20:05 (GMT)
committerGitHub <noreply@github.com>2024-04-10 14:20:05 (GMT)
commit79eec66e3dc277ea6ebad8c0b33756eea6a7ab3b (patch)
tree412bb312bdce75fda19bb9145694711cbe8b3e90 /Include/pyport.h
parentef4118222b6d5f4532a2f1e234ba03955348d2a1 (diff)
downloadcpython-79eec66e3dc277ea6ebad8c0b33756eea6a7ab3b.zip
cpython-79eec66e3dc277ea6ebad8c0b33756eea6a7ab3b.tar.gz
cpython-79eec66e3dc277ea6ebad8c0b33756eea6a7ab3b.tar.bz2
gh-112536: Define `_Py_THREAD_SANITIZER` on GCC when TSan is enabled (#117702)
The `__has_feature(thread_sanitizer)` is a Clang-ism. Although new versions of GCC implement `__has_feature`, the `defined(__has_feature)` check still fails on GCC so we don't use that code path.
Diffstat (limited to 'Include/pyport.h')
-rw-r--r--Include/pyport.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 9d7ef00..2ba81a4 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -572,6 +572,9 @@ extern "C" {
# if defined(__SANITIZE_ADDRESS__)
# define _Py_ADDRESS_SANITIZER
# endif
+# if defined(__SANITIZE_THREAD__)
+# define _Py_THREAD_SANITIZER
+# endif
#endif