Mac OS X 10.6 needed for pthread_threadid_np(), fixes #7356
authorIan Lynagh <ian@well-typed.com>
Sat, 1 Dec 2012 23:22:48 +0000 (23:22 +0000)
committerIan Lynagh <ian@well-typed.com>
Sat, 1 Dec 2012 23:22:48 +0000 (23:22 +0000)
Based on a patch from Thorkil Naur.

rts/posix/OSThreads.c

index 2fa5670..ae31966 100644 (file)
@@ -337,7 +337,8 @@ KernelThreadId kernelThreadId (void)
 #elif defined(freebsd_HOST_OS) && (__FreeBSD_version >= 900031)
     return pthread_getthreadid_np();
 
-#elif defined(darwin_HOST_OS)
+// Check for OS X >= 10.6 (see #7356)
+#elif defined(darwin_HOST_OS) && !(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < 1060)
     uint64_t ktid;
     pthread_threadid_np(NULL, &ktid);
     return ktid;