Fix emscripten sleep

This commit is contained in:
Ethan O'Brien 2023-07-14 11:49:58 -05:00 committed by LibretroAdmin
parent e5c0ab17e4
commit 24b410476b
2 changed files with 7 additions and 0 deletions

View File

@ -205,6 +205,9 @@ for f in `ls -v *_${platform}.${EXT}`; do
whole_archive=
big_stack=
if [ $PLATFORM = "emscripten" ]; then
async=1 #emscripten needs async to sleep
fi
if [ $name = "nxengine" ] ; then
echo "Applying whole archive linking..."
whole_archive="WHOLE_ARCHIVE_LINK=1"

View File

@ -39,6 +39,8 @@
#include <psp2/kernel/threadmgr.h>
#elif defined(_3DS)
#include <3ds.h>
#elif defined(EMSCRIPTEN)
#include <emscripten/emscripten.h>
#else
#include <time.h>
#endif
@ -99,6 +101,8 @@ static int nanosleepDOS(const struct timespec *rqtp, struct timespec *rmtp)
#define retro_sleep(msec) (usleep(1000 * (msec)))
#elif defined(WIIU)
#define retro_sleep(msec) (OSSleepTicks(ms_to_ticks((msec))))
#elif defined(EMSCRIPTEN)
#define retro_sleep(msec) (emscripten_sleep(msec))
#else
static INLINE void retro_sleep(unsigned msec)
{