<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- include/spdlog/details/os.h	2018-05-22 01:38:13.000000000 +0800
+++ include/spdlog/details/os.h	2024-08-25 09:14:56.000000000 +0800
@@ -49,6 +49,10 @@
 
 #endif // unix
 
+#if defined __APPLE__
+#include &lt;AvailabilityMacros.h&gt;
+#endif
+
 #ifndef __has_feature      // Clang - feature checking macros.
 #define __has_feature(x) 0 // Compatibility with non-clang compilers.
 #endif
@@ -337,7 +341,17 @@
     return static_cast&lt;size_t&gt;(tid);
 #elif __APPLE__
     uint64_t tid;
-    pthread_threadid_np(nullptr, &amp;tid);
+#if (MAC_OS_X_VERSION_MAX_ALLOWED &lt; 1060) || defined(__POWERPC__)
+        tid = pthread_mach_thread_np(pthread_self());
+#elif MAC_OS_X_VERSION_MIN_REQUIRED &lt; 1060
+        if (&amp;pthread_threadid_np) {
+            pthread_threadid_np(nullptr, &amp;tid);
+        } else {
+            tid = pthread_mach_thread_np(pthread_self());
+        }
+#else
+        pthread_threadid_np(nullptr, &amp;tid);
+#endif
     return static_cast&lt;size_t&gt;(tid);
 #else // Default to standard C++11 (other Unix)
     return static_cast&lt;size_t&gt;(std::hash&lt;std::thread::id&gt;()(std::this_thread::get_id()));
</pre></body></html>