File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -563,7 +563,13 @@ static inline size_t js__malloc_usable_size(const void *ptr)
563
563
564
564
/* Cross-platform threading APIs. */
565
565
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
567
573
568
574
#if defined(_WIN32 )
569
575
#define JS_ONCE_INIT INIT_ONCE_STATIC_INIT
Original file line number Diff line number Diff line change @@ -80,19 +80,18 @@ extern char **environ;
80
80
81
81
#endif /* _WIN32 */
82
82
83
- #if !defined(__wasi__ )
84
- /* enable the os.Worker API. IT relies on POSIX threads */
85
- #define USE_WORKER
83
+ #include "cutils.h"
84
+ #include "list.h"
85
+ #include "quickjs-libc.h"
86
+
87
+ #if JS_HAVE_THREADS
88
+ #define USE_WORKER // enable os.Worker
86
89
#endif
87
90
88
91
#ifdef USE_WORKER
89
92
#include "quickjs-c-atomics.h"
90
93
#endif
91
94
92
- #include "cutils.h"
93
- #include "list.h"
94
- #include "quickjs-libc.h"
95
-
96
95
#ifndef MAX_SAFE_INTEGER // already defined in amalgamation builds
97
96
#define MAX_SAFE_INTEGER (((int64_t) 1 << 53) - 1)
98
97
#endif
You can’t perform that action at this time.
0 commit comments