Fixed compile error
authorSam Lantinga <slouken@libsdl.org>
Thu, 13 Apr 2006 14:27:58 +0000
changeset 1630eba962f9d603
parent 1629 ef4a796e7f24
child 1631 510b009a864c
Fixed compile error
src/thread/pthread/SDL_syssem.c
     1.1 --- a/src/thread/pthread/SDL_syssem.c	Thu Apr 13 14:17:48 2006 +0000
     1.2 +++ b/src/thread/pthread/SDL_syssem.c	Thu Apr 13 14:27:58 2006 +0000
     1.3 @@ -35,7 +35,7 @@
     1.4  #else
     1.5  
     1.6  struct SDL_semaphore {
     1.7 -	sem_t *sem;
     1.8 +	sem_t sem;
     1.9  };
    1.10  
    1.11  /* Create a semaphore, initialized with value */
    1.12 @@ -43,12 +43,10 @@
    1.13  {
    1.14  	SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem));
    1.15  	if ( sem ) {
    1.16 -		if ( sem_init(&sem->sem_data, 0, initial_value) < 0 ) {
    1.17 +		if ( sem_init(&sem->sem, 0, initial_value) < 0 ) {
    1.18  			SDL_SetError("sem_init() failed");
    1.19  			SDL_free(sem);
    1.20  			sem = NULL;
    1.21 -		} else {
    1.22 -			sem->sem = &sem->sem_data;
    1.23  		}
    1.24  	} else {
    1.25  		SDL_OutOfMemory();
    1.26 @@ -59,7 +57,7 @@
    1.27  void SDL_DestroySemaphore(SDL_sem *sem)
    1.28  {
    1.29  	if ( sem ) {
    1.30 -		sem_destroy(sem->sem);
    1.31 +		sem_destroy(&sem->sem);
    1.32  		SDL_free(sem);
    1.33  	}
    1.34  }
    1.35 @@ -73,7 +71,7 @@
    1.36  		return -1;
    1.37  	}
    1.38  	retval = SDL_MUTEX_TIMEDOUT;
    1.39 -	if ( sem_trywait(sem->sem) == 0 ) {
    1.40 +	if ( sem_trywait(&sem->sem) == 0 ) {
    1.41  		retval = 0;
    1.42  	}
    1.43  	return retval;
    1.44 @@ -88,7 +86,7 @@
    1.45  		return -1;
    1.46  	}
    1.47  
    1.48 -	retval = sem_wait(sem->sem);
    1.49 +	retval = sem_wait(&sem->sem);
    1.50  	if ( retval < 0 ) {
    1.51  		SDL_SetError("sem_wait() failed");
    1.52  	}
    1.53 @@ -130,7 +128,7 @@
    1.54  {
    1.55  	int ret = 0;
    1.56  	if ( sem ) {
    1.57 -		sem_getvalue(sem->sem, &ret);
    1.58 +		sem_getvalue(&sem->sem, &ret);
    1.59  		if ( ret < 0 ) {
    1.60  			ret = 0;
    1.61  		}
    1.62 @@ -147,7 +145,7 @@
    1.63  		return -1;
    1.64  	}
    1.65  
    1.66 -	retval = sem_post(sem->sem);
    1.67 +	retval = sem_post(&sem->sem);
    1.68  	if ( retval < 0 ) {
    1.69  		SDL_SetError("sem_post() failed");
    1.70  	}