Whoops, let's not redefine the actual symbol.
This commit is contained in:
parent
20144052f8
commit
732a5d8165
1 changed files with 7 additions and 7 deletions
|
@ -72,10 +72,10 @@ RunThread(void *data)
|
||||||
|
|
||||||
#if defined(__MACOSX__) || defined(__IPHONEOS__)
|
#if defined(__MACOSX__) || defined(__IPHONEOS__)
|
||||||
static SDL_bool checked_setname = SDL_FALSE;
|
static SDL_bool checked_setname = SDL_FALSE;
|
||||||
static int (*pthread_setname_np)(const char*) = NULL;
|
static int (*ppthread_setname_np)(const char*) = NULL;
|
||||||
#elif defined(__LINUX__)
|
#elif defined(__LINUX__)
|
||||||
static SDL_bool checked_setname = SDL_FALSE;
|
static SDL_bool checked_setname = SDL_FALSE;
|
||||||
static int (*pthread_setname_np)(pthread_t, const char*) = NULL;
|
static int (*ppthread_setname_np)(pthread_t, const char*) = NULL;
|
||||||
#endif
|
#endif
|
||||||
int
|
int
|
||||||
SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
|
SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
|
||||||
|
@ -87,9 +87,9 @@ SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
|
||||||
if (!checked_setname) {
|
if (!checked_setname) {
|
||||||
void *fn = dlsym(RTLD_DEFAULT, "pthread_setname_np");
|
void *fn = dlsym(RTLD_DEFAULT, "pthread_setname_np");
|
||||||
#if defined(__MACOSX__) || defined(__IPHONEOS__)
|
#if defined(__MACOSX__) || defined(__IPHONEOS__)
|
||||||
pthread_setname_np = (int(*)(const char*)) fn;
|
ppthread_setname_np = (int(*)(const char*)) fn;
|
||||||
#elif defined(__LINUX__)
|
#elif defined(__LINUX__)
|
||||||
pthread_setname_np = (int(*)(pthread_t, const char*)) fn;
|
ppthread_setname_np = (int(*)(pthread_t, const char*)) fn;
|
||||||
#endif
|
#endif
|
||||||
checked_setname = SDL_TRUE;
|
checked_setname = SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -120,11 +120,11 @@ SDL_SYS_SetupThread(const char *name)
|
||||||
if (name != NULL) {
|
if (name != NULL) {
|
||||||
#if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__)
|
#if defined(__MACOSX__) || defined(__IPHONEOS__) || defined(__LINUX__)
|
||||||
SDL_assert(checked_setname);
|
SDL_assert(checked_setname);
|
||||||
if (pthread_setname_np) {
|
if (ppthread_setname_np != NULL) {
|
||||||
#if defined(__MACOSX__) || defined(__IPHONEOS__)
|
#if defined(__MACOSX__) || defined(__IPHONEOS__)
|
||||||
pthread_setname_np(name);
|
ppthread_setname_np(name);
|
||||||
#elif defined(__LINUX__)
|
#elif defined(__LINUX__)
|
||||||
pthread_setname_np(pthread_self(), name);
|
ppthread_setname_np(pthread_self(), name);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#elif HAVE_PTHREAD_SETNAME_NP
|
#elif HAVE_PTHREAD_SETNAME_NP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue