Really fixed the Mac build this time.
authorSam Lantinga <slouken@libsdl.org>
Tue, 23 Oct 2012 23:44:56 -0700
changeset 6605 59132ac5df74
parent 6604 70292a6d7dca
child 6606 593a2618c2ce
Really fixed the Mac build this time.
src/thread/pthread/SDL_systhread.c
--- a/src/thread/pthread/SDL_systhread.c	Tue Oct 23 17:46:57 2012 -0700
+++ b/src/thread/pthread/SDL_systhread.c	Tue Oct 23 23:44:56 2012 -0700
@@ -39,6 +39,12 @@
 #endif
 #endif // __LINUX__
 
+#if ( (__MACOSX__ && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)) || \
+      (__IPHONEOS__ && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 30200)) )
+#define NEED_DYNAMIC_PTHREAD_SETNAME_NP
+#include <dlfcn.h>
+#endif
+
 #include "SDL_platform.h"
 #include "SDL_thread.h"
 #include "../SDL_thread_c.h"
@@ -92,8 +98,7 @@
     sigset_t mask;
 
     if (name != NULL) {
-#if ( (__MACOSX__ && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)) || \
-      (__IPHONEOS__ && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 30200)) )
+#ifdef NEED_DYNAMIC_PTHREAD_SETNAME_NP
         int (*dynamic_pthread_setname_np)(const char*);
         *(void**)(&dynamic_pthread_setname_np) = dlsym(RTLD_DEFAULT, "pthread_setname_np");
         if ( dynamic_pthread_setname_np )