Mac and Linux SDL2 binary snapshots
Edward Rudd
2021-06-15 dec7875a6e23212021e4d9080330a42832dfe02a
source/src/timer/unix/SDL_systimer.c
@@ -28,8 +28,12 @@
#include <errno.h>
#include "SDL_timer.h"
#include "SDL_assert.h"
#include "SDL_hints.h"
#include "../SDL_timer_c.h"
#ifdef __EMSCRIPTEN__
#include <emscripten.h>
#endif
/* The clock_gettime provides monotonous time, so we should use it if
   it's available. The clock_gettime function is behind ifdef
@@ -186,6 +190,13 @@
void
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;
#if HAVE_NANOSLEEP