gh-112536: Define `_Py_THREAD_SANITIZER` on GCC when TSan is enabled (GH-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.
(cherry picked from commit
79eec66e3dc277ea6ebad8c0b33756eea6a7ab3b)
Co-authored-by: Sam Gross <colesbury@gmail.com>
# if defined(__SANITIZE_ADDRESS__)
# define _Py_ADDRESS_SANITIZER
# endif
+# if defined(__SANITIZE_THREAD__)
+# define _Py_THREAD_SANITIZER
+# endif
#endif