Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Really fixed the Mac build this time.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 24, 2012
1 parent dd1e4f4 commit 0f347db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/thread/pthread/SDL_systhread.c
Expand Up @@ -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 <dlfcn.h>
#endif

#include "SDL_platform.h"
#include "SDL_thread.h"
#include "../SDL_thread_c.h"
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 0f347db

Please sign in to comment.