diff --git a/Makefile b/Makefile index cf88a72..715370e 100644 --- a/Makefile +++ b/Makefile @@ -148,6 +148,9 @@ ifeq ($(shell $(CC) -o /dev/null compat/test-closefrom.c 2>/dev/null && echo 1), DEFINES+=-DHAVE_CLOSEFROM endif endif +ifdef CONFIG_NO_WORKER +DEFINES+=-DCONFIG_NO_WORKER +endif CFLAGS+=$(DEFINES) CFLAGS_DEBUG=$(CFLAGS) -O0 diff --git a/quickjs-libc.c b/quickjs-libc.c index 141f79f..93e0d06 100644 --- a/quickjs-libc.c +++ b/quickjs-libc.c @@ -64,7 +64,7 @@ typedef sig_t sighandler_t; #endif -#if !defined(_WIN32) +#if !defined(_WIN32) && !defined(CONFIG_NO_WORKER) /* enable the os.Worker API. IT relies on POSIX threads */ #define USE_WORKER #endif diff --git a/quickjs.c b/quickjs.c index 642ae34..0d78919 100644 --- a/quickjs.c +++ b/quickjs.c @@ -68,7 +68,7 @@ /* define to include Atomics.* operations which depend on the OS threads */ -#if !defined(EMSCRIPTEN) +#if !defined(EMSCRIPTEN) && !defined(CONFIG_NO_WORKER) #define CONFIG_ATOMICS #endif