Mesa (8.0): darwin: Address a build failure on Leopard and earlier OS versions

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri May 18 18:33:39 UTC 2012


Module: Mesa
Branch: 8.0
Commit: e69758260b0403d47ec61692e1fc18bcbb14865e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e69758260b0403d47ec61692e1fc18bcbb14865e

Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri May 18 11:31:24 2012 -0700

darwin: Address a build failure on Leopard and earlier OS versions

<https://trac.macports.org/ticket/34499>

Regression-from: 51691f0767f6a75a1f549cd979a878a0ad12a228
Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
(cherry picked from commit 27b821bc95ea01cc4292ada9c7c65211580d1f98)

---

 src/glx/apple/apple_glx_log.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/glx/apple/apple_glx_log.c b/src/glx/apple/apple_glx_log.c
index 9ebf666..5b9a865 100644
--- a/src/glx/apple/apple_glx_log.c
+++ b/src/glx/apple/apple_glx_log.c
@@ -76,7 +76,17 @@ void _apple_glx_vlog(int level, const char *file, const char *function,
     uint64_t thread = 0;
 
     if (pthread_is_threaded_np()) {
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+        thread = (uint64_t)(uintptr_t)pthread_self();
+#elif MAC_OS_X_VERSION_MIN_REQUIRED < 1060
+        if (&pthread_threadid_np) {
+            pthread_threadid_np(NULL, &thread);
+        } else {
+            thread = (uint64_t)(uintptr_t)pthread_self();
+        }
+#else
         pthread_threadid_np(NULL, &thread);
+#endif
     }
 
     if (diagnostic) {




More information about the mesa-commit mailing list