summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--makefiledir/Makefile.config_writer2
-rw-r--r--thread.c8
3 files changed, 10 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index cd155a6f1..379f92ab2 100644
--- a/Makefile
+++ b/Makefile
@@ -511,6 +511,10 @@ ifdef DISABLE_ASSERTS
CFLAGS += -DNDEBUG
endif
+ifdef NO_THREADS
+CFLAGS += -DNO_THREADS
+endif
+
# automatically disables asserts for release
ifdef RELEASE
ifndef ENABLE_ASSERTS
diff --git a/makefiledir/Makefile.config_writer b/makefiledir/Makefile.config_writer
index b0dd83b4b..166973b53 100644
--- a/makefiledir/Makefile.config_writer
+++ b/makefiledir/Makefile.config_writer
@@ -32,6 +32,8 @@ $(MAKE_CONFIG):
$(call CONFIG_LINE,\# Disable asserts. Leave them on for easier bug finding)
$(call CONFIG_LINE,DISABLE_ASSERTS:=$(DISABLE_ASSERTS))
+ $(call CONFIG_LINE,\# Disable threads. Useful if you do not like it and for testing)
+ $(call CONFIG_LINE,NO_THREADS:=$(NO_THREADS))
$(call CONFIG_LINE,)
$(call CONFIG_LINE,\# See Makefile for details on these paths)
diff --git a/thread.c b/thread.c
index a2475408b..ab2cfd21d 100644
--- a/thread.c
+++ b/thread.c
@@ -4,10 +4,10 @@
#include "thread.h"
#include <stdlib.h>
-#if defined(__AMIGA__) || defined(__MORPHOS__)
-OTTDThread* OTTDCreateThread(OTTDThreadFunc function, void* arg) { return NULL; }
-void* OTTDJoinThread(OTTDThread* t) { return NULL; }
-void OTTDExitThread() { NOT_REACHED(); };
+#if defined(__AMIGA__) || defined(__MORPHOS__) || defined(NO_THREADS)
+OTTDThread *OTTDCreateThread(OTTDThreadFunc function, void *arg) { return NULL; }
+void *OTTDJoinThread(OTTDThread *t) { return NULL; }
+void OTTDExitThread(void) { NOT_REACHED(); };
#elif defined(__OS2__)