# https://github.com/gabime/spdlog/commit/c65aa4e4889939c1afa82001db349cac237a13f8 --- deps/spdlog/include/spdlog/details/os-inl.h 2023-01-15 03:29:53.000000000 +0800 +++ deps/spdlog/include/spdlog/details/os-inl.h 2023-11-19 11:37:02.000000000 +0800 @@ -58,6 +58,10 @@ # include // for thr_self # endif +#if defined __APPLE__ +# include +#endif + #endif // unix #ifndef __has_feature // Clang - feature checking macros. @@ -353,7 +357,17 @@ return static_cast(::thr_self()); #elif __APPLE__ uint64_t tid; - pthread_threadid_np(nullptr, &tid); +# 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); #else // Default to standard C++11 (other Unix) return static_cast(std::hash()(std::this_thread::get_id()));