mirror of https://github.com/encounter/SDL.git
timer: Fix Emscripten declaration-after-statement error
This commit is contained in:
parent
53df0e6619
commit
99af3281ee
|
@ -187,13 +187,6 @@ SDL_GetPerformanceFrequency(void)
|
||||||
void
|
void
|
||||||
SDL_Delay(Uint32 ms)
|
SDL_Delay(Uint32 ms)
|
||||||
{
|
{
|
||||||
#ifdef __EMSCRIPTEN__
|
|
||||||
if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) {
|
|
||||||
/* pseudo-synchronous pause, used directly or through e.g. SDL_WaitEvent */
|
|
||||||
emscripten_sleep(ms);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
int was_error;
|
int was_error;
|
||||||
|
|
||||||
#if HAVE_NANOSLEEP
|
#if HAVE_NANOSLEEP
|
||||||
|
@ -203,6 +196,14 @@ SDL_Delay(Uint32 ms)
|
||||||
Uint64 then, now, elapsed;
|
Uint64 then, now, elapsed;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
if (emscripten_has_asyncify() && SDL_GetHintBoolean(SDL_HINT_EMSCRIPTEN_ASYNCIFY, SDL_TRUE)) {
|
||||||
|
/* pseudo-synchronous pause, used directly or through e.g. SDL_WaitEvent */
|
||||||
|
emscripten_sleep(ms);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Set the timeout interval */
|
/* Set the timeout interval */
|
||||||
#if HAVE_NANOSLEEP
|
#if HAVE_NANOSLEEP
|
||||||
elapsed.tv_sec = ms / 1000;
|
elapsed.tv_sec = ms / 1000;
|
||||||
|
|
Loading…
Reference in New Issue