From 0f347dbc0f11657b3b4182c3e535ac7ee0727949 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 23 Oct 2012 23:44:56 -0700 Subject: [PATCH] Really fixed the Mac build this time. --- src/thread/pthread/SDL_systhread.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c index 64b48dce2..196ffda62 100644 --- a/src/thread/pthread/SDL_systhread.c +++ b/src/thread/pthread/SDL_systhread.c @@ -39,6 +39,12 @@ extern int pthread_setname_np (pthread_t __target_thread, __const char *__name) #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 +#endif + #include "SDL_platform.h" #include "SDL_thread.h" #include "../SDL_thread_c.h" @@ -92,8 +98,7 @@ SDL_SYS_SetupThread(const char *name) 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 )