diff --git a/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp b/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_interceptors_mac.cpp @@ -23,9 +23,12 @@ #include #include #include -#include #include +#if defined(__has_include) && __has_include() +#include +#endif + #if defined(__has_include) && __has_include() #include #endif // #if defined(__has_include) && __has_include() @@ -247,6 +250,8 @@ REAL(os_lock_unlock)(lock); } +#if defined(__has_include) && __has_include() + TSAN_INTERCEPTOR(void, os_unfair_lock_lock, os_unfair_lock_t lock) { if (!cur_thread()->is_inited || cur_thread()->is_dead) { return REAL(os_unfair_lock_lock)(lock); @@ -286,6 +291,8 @@ REAL(os_unfair_lock_unlock)(lock); } +#endif // #if defined(__has_include) && __has_include() + #if defined(__has_include) && __has_include() TSAN_INTERCEPTOR(void, xpc_connection_set_event_handler,