mirror of
https://github.com/encounter/SDL.git
synced 2025-12-21 02:39:10 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user