You've already forked macports-ports
mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
7da358db76
work around no copyfile on < 10.5 work around no pthread_threadid_np on < 10.6 closes: https://trac.macports.org/ticket/60342 closes: https://trac.macports.org/ticket/59772 closes: https://trac.macports.org/ticket/59827 Thanks to @dgelessus as well for valuable input There is a comprehensive patch upstream being considered for a future python release.
24 lines
771 B
Diff
24 lines
771 B
Diff
--- Python/thread_pthread.h.orig 2020-03-07 12:42:06.000000000 -0800
|
|
+++ Python/thread_pthread.h 2020-03-07 12:48:22.000000000 -0800
|
|
@@ -325,9 +325,19 @@
|
|
{
|
|
if (!initialized)
|
|
PyThread_init_thread();
|
|
#ifdef __APPLE__
|
|
uint64_t native_id;
|
|
- (void) pthread_threadid_np(NULL, &native_id);
|
|
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
|
|
+ native_id = pthread_mach_thread_np(pthread_self());
|
|
+#elif MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
|
+ if (&pthread_threadid_np) {
|
|
+ (void) pthread_threadid_np(NULL, &native_id);
|
|
+ } else {
|
|
+ native_id = pthread_mach_thread_np(pthread_self());
|
|
+ }
|
|
+#else
|
|
+ (void) pthread_threadid_np(NULL, &native_id);
|
|
+#endif
|
|
#elif defined(__linux__)
|
|
pid_t native_id;
|
|
native_id = syscall(SYS_gettid);
|