Mercurial > sdl-ios-xcode
comparison src/thread/os2/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 |
---|---|
46 { | 46 { |
47 SDL_sem *sem; | 47 SDL_sem *sem; |
48 ULONG ulrc; | 48 ULONG ulrc; |
49 | 49 |
50 /* Allocate sem memory */ | 50 /* Allocate sem memory */ |
51 sem = (SDL_sem *)malloc(sizeof(*sem)); | 51 sem = (SDL_sem *)SDL_malloc(sizeof(*sem)); |
52 if ( sem ) { | 52 if ( sem ) { |
53 /* Create the mutex semaphore */ | 53 /* Create the mutex semaphore */ |
54 ulrc = DosCreateMutexSem(NULL,&(sem->id),0,TRUE); | 54 ulrc = DosCreateMutexSem(NULL,&(sem->id),0,TRUE); |
55 if ( ulrc ) { | 55 if ( ulrc ) { |
56 SDL_SetError("Couldn't create semaphore"); | 56 SDL_SetError("Couldn't create semaphore"); |
57 free(sem); | 57 SDL_free(sem); |
58 sem = NULL; | 58 sem = NULL; |
59 } else | 59 } else |
60 { | 60 { |
61 DosCreateEventSem(NULL, &(sem->changed), 0, FALSE); | 61 DosCreateEventSem(NULL, &(sem->changed), 0, FALSE); |
62 sem->value = initial_value; | 62 sem->value = initial_value; |
75 if ( sem->id ) { | 75 if ( sem->id ) { |
76 DosCloseEventSem(sem->changed); | 76 DosCloseEventSem(sem->changed); |
77 DosCloseMutexSem(sem->id); | 77 DosCloseMutexSem(sem->id); |
78 sem->id = 0; | 78 sem->id = 0; |
79 } | 79 } |
80 free(sem); | 80 SDL_free(sem); |
81 } | 81 } |
82 } | 82 } |
83 | 83 |
84 DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) | 84 DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) |
85 { | 85 { |