Removed some old Mac OS X cruft.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 30 Jan 2006 18:56:30 +0000
changeset 1300fd068ab116ee
parent 1299 2bf9dda618e5
child 1301 a78446e47413
Removed some old Mac OS X cruft.

Fixes Bugzilla #64.

--ryan.
src/thread/linux/SDL_syssem.c
src/thread/linux/SDL_systhread.c
     1.1 --- a/src/thread/linux/SDL_syssem.c	Mon Jan 30 18:21:44 2006 +0000
     1.2 +++ b/src/thread/linux/SDL_syssem.c	Mon Jan 30 18:56:30 2006 +0000
     1.3 @@ -61,8 +61,6 @@
     1.4  
     1.5  #ifdef MACOSX
     1.6  #define USE_NAMED_SEMAPHORES
     1.7 -/* Broken sem_getvalue() in MacOS X Public Beta */
     1.8 -#define BROKEN_SEMGETVALUE
     1.9  #endif /* MACOSX */
    1.10  
    1.11  struct SDL_semaphore {
    1.12 @@ -70,12 +68,6 @@
    1.13  #ifndef USE_NAMED_SEMAPHORES
    1.14  	sem_t sem_data;
    1.15  #endif
    1.16 -#ifdef BROKEN_SEMGETVALUE
    1.17 -	/* This is a little hack for MacOS X -
    1.18 -	   It's not thread-safe, but it's better than nothing
    1.19 -	 */
    1.20 -	int sem_value;
    1.21 -#endif
    1.22  };
    1.23  
    1.24  /* Create a semaphore, initialized with value */
    1.25 @@ -105,12 +97,6 @@
    1.26  			sem->sem = &sem->sem_data;
    1.27  		}
    1.28  #endif /* USE_NAMED_SEMAPHORES */
    1.29 -
    1.30 -#ifdef BROKEN_SEMGETVALUE
    1.31 -		if ( sem ) {
    1.32 -			sem->sem_value = initial_value;
    1.33 -		}
    1.34 -#endif /* BROKEN_SEMGETVALUE */
    1.35  	} else {
    1.36  		SDL_OutOfMemory();
    1.37  	}
    1.38 @@ -139,9 +125,6 @@
    1.39  	}
    1.40  	retval = SDL_MUTEX_TIMEDOUT;
    1.41  	if ( sem_trywait(sem->sem) == 0 ) {
    1.42 -#ifdef BROKEN_SEMGETVALUE
    1.43 -		--sem->sem_value;
    1.44 -#endif
    1.45  		retval = 0;
    1.46  	}
    1.47  	return retval;
    1.48 @@ -156,9 +139,6 @@
    1.49  		return -1;
    1.50  	}
    1.51  
    1.52 -#ifdef BROKEN_SEMGETVALUE
    1.53 -	--sem->sem_value;
    1.54 -#endif
    1.55  	retval = sem_wait(sem->sem);
    1.56  	if ( retval < 0 ) {
    1.57  		SDL_SetError("sem_wait() failed");
    1.58 @@ -200,11 +180,7 @@
    1.59  {
    1.60  	int ret = 0;
    1.61  	if ( sem ) {
    1.62 -#ifdef BROKEN_SEMGETVALUE
    1.63 -		ret = sem->sem_value;
    1.64 -#else
    1.65  		sem_getvalue(sem->sem, &ret);
    1.66 -#endif
    1.67  		if ( ret < 0 ) {
    1.68  			ret = 0;
    1.69  		}
    1.70 @@ -221,9 +197,6 @@
    1.71  		return -1;
    1.72  	}
    1.73  
    1.74 -#ifdef BROKEN_SEMGETVALUE
    1.75 -	++sem->sem_value;
    1.76 -#endif
    1.77  	retval = sem_post(sem->sem);
    1.78  	if ( retval < 0 ) {
    1.79  		SDL_SetError("sem_post() failed");
     2.1 --- a/src/thread/linux/SDL_systhread.c	Mon Jan 30 18:21:44 2006 +0000
     2.2 +++ b/src/thread/linux/SDL_systhread.c	Mon Jan 30 18:56:30 2006 +0000
     2.3 @@ -61,13 +61,11 @@
     2.4  
     2.5  #include <signal.h>
     2.6  
     2.7 -#if !defined(MACOSX) /* pthread_sigmask seems to be missing on MacOS X? */
     2.8  /* List of signals to mask in the subthreads */
     2.9  static int sig_list[] = {
    2.10  	SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
    2.11  	SIGVTALRM, SIGPROF, 0
    2.12  };
    2.13 -#endif /* !MACOSX */
    2.14  
    2.15  #ifdef SDL_USE_PTHREADS
    2.16  
    2.17 @@ -102,7 +100,6 @@
    2.18  
    2.19  void SDL_SYS_SetupThread(void)
    2.20  {
    2.21 -#if !defined(MACOSX) /* pthread_sigmask seems to be missing on MacOS X? */
    2.22  	int i;
    2.23  	sigset_t mask;
    2.24  
    2.25 @@ -112,7 +109,6 @@
    2.26  		sigaddset(&mask, sig_list[i]);
    2.27  	}
    2.28  	pthread_sigmask(SIG_BLOCK, &mask, 0);
    2.29 -#endif /* !MACOSX */
    2.30  
    2.31  #ifdef PTHREAD_CANCEL_ASYNCHRONOUS
    2.32  	/* Allow ourselves to be asynchronously cancelled */