# HG changeset patch # User truelight # Date 1156081684 0 # Node ID 9682c016b892d825a700723cb8f4125c4d29da2d # Parent ae32c5fab67bc24f8ed3ae14fe01a0c88301ee13 (svn r5978) -Add: allow a switch in Makefile.config to disable threads in OpenTTD (no matter what system you are on). Only useful for testing. diff -r ae32c5fab67b -r 9682c016b892 Makefile --- a/Makefile Sun Aug 20 13:39:33 2006 +0000 +++ b/Makefile Sun Aug 20 13:48:04 2006 +0000 @@ -511,6 +511,10 @@ CFLAGS += -DNDEBUG endif +ifdef NO_THREADS +CFLAGS += -DNO_THREADS +endif + # automatically disables asserts for release ifdef RELEASE ifndef ENABLE_ASSERTS diff -r ae32c5fab67b -r 9682c016b892 makefiledir/Makefile.config_writer --- a/makefiledir/Makefile.config_writer Sun Aug 20 13:39:33 2006 +0000 +++ b/makefiledir/Makefile.config_writer Sun Aug 20 13:48:04 2006 +0000 @@ -32,6 +32,8 @@ $(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 -r ae32c5fab67b -r 9682c016b892 thread.c --- a/thread.c Sun Aug 20 13:39:33 2006 +0000 +++ b/thread.c Sun Aug 20 13:48:04 2006 +0000 @@ -4,10 +4,10 @@ #include "thread.h" #include -#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__)