From 3b81a9489eabad1faa6c67bb0d5685d7a3eb0386 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 13 Oct 2010 00:48:40 +0000 Subject: SOUND: Allow TiMidity support to be disabled via configure. svn-id: r53395 --- backends/midi/timidity.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'backends/midi/timidity.cpp') diff --git a/backends/midi/timidity.cpp b/backends/midi/timidity.cpp index f507f1e00a..16c1cc43be 100644 --- a/backends/midi/timidity.cpp +++ b/backends/midi/timidity.cpp @@ -34,7 +34,9 @@ * */ -#if defined (UNIX) +#include "common/scummsys.h" + +#if defined(USE_TIMIDITY) #include "common/util.h" #include "common/endian.h" -- cgit v1.2.3 From 44393b2dc8ba78342dcbb7df39eca2e9e1f6e429 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 30 Oct 2010 21:27:42 +0000 Subject: ALL: Add code to help stop people from accidentally using "bad" APIs A new header file common/forbidden.h is included by scummsys.h and it re-#defines numerous symbols like fopen(), fread(), system(), etc. with garbage, in order to provoke compile errors in any code using them. If a .cpp file really *must* use any of these (e.g. because it is a backend file), then these redefinitions can be disabled by #defining FORBIDDEN_SYMBOL_ALLOW_ALL as the first thing in the .cpp file. Whenever this is done, an explanatory comment should be added. Note that this system cannot catch all "bad" usages (notably the Lua code in the sword25 engine), as it can only work if scummsys.h is included. svn-id: r53961 --- backends/midi/timidity.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backends/midi/timidity.cpp') diff --git a/backends/midi/timidity.cpp b/backends/midi/timidity.cpp index 16c1cc43be..d79a83809f 100644 --- a/backends/midi/timidity.cpp +++ b/backends/midi/timidity.cpp @@ -34,6 +34,9 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include "common/scummsys.h" #if defined(USE_TIMIDITY) -- cgit v1.2.3