# HG changeset patch # User Ryan C. Gordon # Date 1138647390 0 # Node ID fd068ab116eefdaafe2f179b4cb51c0e8f66dd55 # Parent 2bf9dda618e56e8e5137d8d64547c5e83fc593d1 Removed some old Mac OS X cruft. Fixes Bugzilla #64. --ryan. diff -r 2bf9dda618e5 -r fd068ab116ee src/thread/linux/SDL_syssem.c --- a/src/thread/linux/SDL_syssem.c Mon Jan 30 18:21:44 2006 +0000 +++ b/src/thread/linux/SDL_syssem.c Mon Jan 30 18:56:30 2006 +0000 @@ -61,8 +61,6 @@ #ifdef MACOSX #define USE_NAMED_SEMAPHORES -/* Broken sem_getvalue() in MacOS X Public Beta */ -#define BROKEN_SEMGETVALUE #endif /* MACOSX */ struct SDL_semaphore { @@ -70,12 +68,6 @@ #ifndef USE_NAMED_SEMAPHORES sem_t sem_data; #endif -#ifdef BROKEN_SEMGETVALUE - /* This is a little hack for MacOS X - - It's not thread-safe, but it's better than nothing - */ - int sem_value; -#endif }; /* Create a semaphore, initialized with value */ @@ -105,12 +97,6 @@ sem->sem = &sem->sem_data; } #endif /* USE_NAMED_SEMAPHORES */ - -#ifdef BROKEN_SEMGETVALUE - if ( sem ) { - sem->sem_value = initial_value; - } -#endif /* BROKEN_SEMGETVALUE */ } else { SDL_OutOfMemory(); } @@ -139,9 +125,6 @@ } retval = SDL_MUTEX_TIMEDOUT; if ( sem_trywait(sem->sem) == 0 ) { -#ifdef BROKEN_SEMGETVALUE - --sem->sem_value; -#endif retval = 0; } return retval; @@ -156,9 +139,6 @@ return -1; } -#ifdef BROKEN_SEMGETVALUE - --sem->sem_value; -#endif retval = sem_wait(sem->sem); if ( retval < 0 ) { SDL_SetError("sem_wait() failed"); @@ -200,11 +180,7 @@ { int ret = 0; if ( sem ) { -#ifdef BROKEN_SEMGETVALUE - ret = sem->sem_value; -#else sem_getvalue(sem->sem, &ret); -#endif if ( ret < 0 ) { ret = 0; } @@ -221,9 +197,6 @@ return -1; } -#ifdef BROKEN_SEMGETVALUE - ++sem->sem_value; -#endif retval = sem_post(sem->sem); if ( retval < 0 ) { SDL_SetError("sem_post() failed"); diff -r 2bf9dda618e5 -r fd068ab116ee src/thread/linux/SDL_systhread.c --- a/src/thread/linux/SDL_systhread.c Mon Jan 30 18:21:44 2006 +0000 +++ b/src/thread/linux/SDL_systhread.c Mon Jan 30 18:56:30 2006 +0000 @@ -61,13 +61,11 @@ #include -#if !defined(MACOSX) /* pthread_sigmask seems to be missing on MacOS X? */ /* List of signals to mask in the subthreads */ static int sig_list[] = { SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH, SIGVTALRM, SIGPROF, 0 }; -#endif /* !MACOSX */ #ifdef SDL_USE_PTHREADS @@ -102,7 +100,6 @@ void SDL_SYS_SetupThread(void) { -#if !defined(MACOSX) /* pthread_sigmask seems to be missing on MacOS X? */ int i; sigset_t mask; @@ -112,7 +109,6 @@ sigaddset(&mask, sig_list[i]); } pthread_sigmask(SIG_BLOCK, &mask, 0); -#endif /* !MACOSX */ #ifdef PTHREAD_CANCEL_ASYNCHRONOUS /* Allow ourselves to be asynchronously cancelled */