mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-28 20:09:38 +08:00
timer: Use the emscripten-specific code on Emscripten, even with threading.
Fixes #14640.
(cherry picked from commit 4d8f84f161)
This commit is contained in:
committed by
Sam Lantinga
parent
d1d0a50751
commit
cfc41248be
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
// #define DEBUG_TIMERS
|
// #define DEBUG_TIMERS
|
||||||
|
|
||||||
#if !defined(SDL_PLATFORM_EMSCRIPTEN) || !defined(SDL_THREADS_DISABLED)
|
#if !defined(SDL_PLATFORM_EMSCRIPTEN)
|
||||||
|
|
||||||
typedef struct SDL_Timer
|
typedef struct SDL_Timer
|
||||||
{
|
{
|
||||||
@@ -407,7 +407,7 @@ bool SDL_RemoveTimer(SDL_TimerID id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else // Emscripten-specific implementation.
|
||||||
|
|
||||||
#include <emscripten/emscripten.h>
|
#include <emscripten/emscripten.h>
|
||||||
#include <emscripten/eventloop.h>
|
#include <emscripten/eventloop.h>
|
||||||
@@ -533,7 +533,7 @@ bool SDL_RemoveTimer(SDL_TimerID id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // !SDL_PLATFORM_EMSCRIPTEN || !SDL_THREADS_DISABLED
|
#endif // !SDL_PLATFORM_EMSCRIPTEN
|
||||||
|
|
||||||
static Uint64 tick_start;
|
static Uint64 tick_start;
|
||||||
static Uint32 tick_numerator_ns;
|
static Uint32 tick_numerator_ns;
|
||||||
|
|||||||
Reference in New Issue
Block a user