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

Commit

Permalink
Patched to compile on Mac OS X (I think).
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 2, 2011
1 parent 9e43637 commit 4a0f485
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/thread/pthread/SDL_systhread.c
Expand Up @@ -73,20 +73,14 @@ SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
return (0);
}

/* make pthread_setname_np() a weak reference even without SDK support. */
#if __MACOSX__ && (MAC_OS_X_VERSION_MAX_ALLOWED < 1060)
int pthread_setname_np(const char*) __attribute__((weak_import,visibility("default")));
#elif __IPHONEOS__ && (__IPHONE_OS_VERSION_MAX_ALLOWED < 30200)
int pthread_setname_np(const char*) __attribute__((weak_import));
#endif

void
SDL_SYS_SetupThread(const char *name)
{
int i;
sigset_t mask;

#if __MACOSX__ || __IPHONEOS__
#if ( (__MACOSX__ && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060)) || \
(__IPHONEOS__ && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 30200)) )
if (pthread_setname_np != NULL) { pthread_setname_np(name); }
#elif HAVE_PTHREAD_SETNAME_NP
pthread_setname_np(pthread_self(), name);
Expand Down

0 comments on commit 4a0f485

Please sign in to comment.