Added a macro SDL_TICKS_PASSED() to correctly compare two 32-bit tick values.
Went through the code and used the macro and fixed a couple places that were using incorrect timestamp comparisons.
This commit is contained in:
parent
84561c952a
commit
367ffcc3af
12 changed files with 23 additions and 21 deletions
|
@ -156,7 +156,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
|
|||
#else
|
||||
end = SDL_GetTicks() + timeout;
|
||||
while ((retval = SDL_SemTryWait(sem)) == SDL_MUTEX_TIMEDOUT) {
|
||||
if ((Sint32)(SDL_GetTicks() - end) >= 0) {
|
||||
if (SDL_TICKS_PASSED(SDL_GetTicks(), end)) {
|
||||
break;
|
||||
}
|
||||
SDL_Delay(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue