comparison src/thread/beos/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 c71e05b4dc2e
comparison
equal deleted inserted replaced
1335:c39265384763 1336:3692456e7b0f
35 /* Create a counting semaphore */ 35 /* Create a counting semaphore */
36 SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) 36 SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
37 { 37 {
38 SDL_sem *sem; 38 SDL_sem *sem;
39 39
40 sem = (SDL_sem *)malloc(sizeof(*sem)); 40 sem = (SDL_sem *)SDL_malloc(sizeof(*sem));
41 if ( sem ) { 41 if ( sem ) {
42 sem->id = create_sem(initial_value, "SDL semaphore"); 42 sem->id = create_sem(initial_value, "SDL semaphore");
43 if ( sem->id < B_NO_ERROR ) { 43 if ( sem->id < B_NO_ERROR ) {
44 SDL_SetError("create_sem() failed"); 44 SDL_SetError("create_sem() failed");
45 free(sem); 45 SDL_free(sem);
46 sem = NULL; 46 sem = NULL;
47 } 47 }
48 } else { 48 } else {
49 SDL_OutOfMemory(); 49 SDL_OutOfMemory();
50 } 50 }
56 { 56 {
57 if ( sem ) { 57 if ( sem ) {
58 if ( sem->id >= B_NO_ERROR ) { 58 if ( sem->id >= B_NO_ERROR ) {
59 delete_sem(sem->id); 59 delete_sem(sem->id);
60 } 60 }
61 free(sem); 61 SDL_free(sem);
62 } 62 }
63 } 63 }
64 64
65 int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) 65 int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
66 { 66 {