[commit: ghc] master: Mac OS X 10.6 needed for pthread_threadid_np(), fixes #7356 (0cb35b5)

Ian Lynagh <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/0cb35b5514e6280ba330bd3a4acb8e6a71c300ff

>---------------------------------------------------------------

commit 0cb35b5514e6280ba330bd3a4acb8e6a71c300ff
Author: Ian Lynagh <[email protected]>
Date:   Sat Dec 1 23:22:48 2012 +0000

    Mac OS X 10.6 needed for pthread_threadid_np(), fixes #7356
    
    Based on a patch from Thorkil Naur.

>---------------------------------------------------------------

 rts/posix/OSThreads.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c
index 2fa5670..ae31966 100644
--- a/rts/posix/OSThreads.c
+++ b/rts/posix/OSThreads.c
@@ -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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.