Mercurial > sdl-ios-xcode
comparison src/thread/riscos/SDL_syssem.c @ 1336:3692456e7b0f
Use SDL_ prefixed versions of C library functions.
FIXME:
Change #include <stdlib.h> to #include "SDL_stdlib.h"
Change #include <string.h> to #include "SDL_string.h"
Make sure nothing else broke because of this...
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 07 Feb 2006 06:59:48 +0000 |
parents | c9b51268668f |
children | 604d73db6802 |
comparison
equal
deleted
inserted
replaced
1335:c39265384763 | 1336:3692456e7b0f |
---|---|
88 }; | 88 }; |
89 | 89 |
90 /* Create a semaphore, initialized with value */ | 90 /* Create a semaphore, initialized with value */ |
91 SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) | 91 SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) |
92 { | 92 { |
93 SDL_sem *sem = (SDL_sem *) malloc(sizeof(SDL_sem)); | 93 SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem)); |
94 if ( sem ) { | 94 if ( sem ) { |
95 if ( sem_init(&sem->sem_data, 0, initial_value) < 0 ) { | 95 if ( sem_init(&sem->sem_data, 0, initial_value) < 0 ) { |
96 SDL_SetError("sem_init() failed"); | 96 SDL_SetError("sem_init() failed"); |
97 free(sem); | 97 SDL_free(sem); |
98 sem = NULL; | 98 sem = NULL; |
99 } else { | 99 } else { |
100 sem->sem = &sem->sem_data; | 100 sem->sem = &sem->sem_data; |
101 } | 101 } |
102 } else { | 102 } else { |
107 | 107 |
108 void SDL_DestroySemaphore(SDL_sem *sem) | 108 void SDL_DestroySemaphore(SDL_sem *sem) |
109 { | 109 { |
110 if ( sem ) { | 110 if ( sem ) { |
111 sem_destroy(sem->sem); | 111 sem_destroy(sem->sem); |
112 free(sem); | 112 SDL_free(sem); |
113 } | 113 } |
114 } | 114 } |
115 | 115 |
116 int SDL_SemTryWait(SDL_sem *sem) | 116 int SDL_SemTryWait(SDL_sem *sem) |
117 { | 117 { |