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/camd.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'backends/midi/camd.cpp') diff --git a/backends/midi/camd.cpp b/backends/midi/camd.cpp index 3486532549..7bf702de58 100644 --- a/backends/midi/camd.cpp +++ b/backends/midi/camd.cpp @@ -22,6 +22,9 @@ * $Id$ */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include "common/scummsys.h" #if defined(__amigaos4__) -- cgit v1.2.3