--- absl/base/internal/sysinfo.cc.orig 2023-08-07 21:40:00.000000000 +0300 +++ absl/base/internal/sysinfo.cc 2023-08-16 00:59:00.596362110 +0300 @@ -58,6 +58,10 @@ #include "absl/base/internal/unscaledcycleclock.h" #include "absl/base/thread_annotations.h" +#if defined __APPLE__ +#include +#endif + namespace absl { ABSL_NAMESPACE_BEGIN namespace base_internal { @@ -428,7 +432,17 @@ // `nullptr` here implies this thread. This only fails if the specified // thread is invalid or the pointer-to-tid is null, so we needn't worry about // it. +#if (MAC_OS_X_VERSION_MAX_ALLOWED < 1060) || defined(__POWERPC__) + tid = pthread_mach_thread_np(pthread_self()); +#elif MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + if (&pthread_threadid_np) { + pthread_threadid_np(nullptr, &tid); + } else { + tid = pthread_mach_thread_np(pthread_self()); + } +#else pthread_threadid_np(nullptr, &tid); +#endif return static_cast(tid); }