Skip to content

Commit c8e29bd

Browse files
committed
fixup! match cutils.h guard
1 parent a74a6fa commit c8e29bd

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

cutils.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,13 @@ static inline size_t js__malloc_usable_size(const void *ptr)
563563

564564
/* Cross-platform threading APIs. */
565565

566-
#if !defined(EMSCRIPTEN) && !defined(__wasi__)
566+
#if defined(EMSCRIPTEN) || defined(__wasi__)
567+
568+
#define JS_HAVE_THREADS 0
569+
570+
#else
571+
572+
#define JS_HAVE_THREADS 1
567573

568574
#if defined(_WIN32)
569575
#define JS_ONCE_INIT INIT_ONCE_STATIC_INIT

quickjs-libc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,8 @@ extern char **environ;
8080

8181
#endif /* _WIN32 */
8282

83-
#if !defined(__wasi__)
84-
/* enable the os.Worker API. IT relies on POSIX threads */
85-
#define USE_WORKER
83+
#if JS_HAVE_THREADS
84+
#define USE_WORKER // enable os.Worker
8685
#endif
8786

8887
#ifdef USE_WORKER

0 commit comments

Comments
 (0)