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/platform/sdl/main.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'backends/platform/sdl/main.cpp') diff --git a/backends/platform/sdl/main.cpp b/backends/platform/sdl/main.cpp index 60bf59689c..a9e1f5cf4b 100644 --- a/backends/platform/sdl/main.cpp +++ b/backends/platform/sdl/main.cpp @@ -23,6 +23,8 @@ * */ +#define FORBIDDEN_SYMBOL_ALLOW_ALL + // Fix for bug #2895217 "MSVC compilation broken with r47595": // We need to keep this on top of the "common/scummsys.h" include, // otherwise we will get errors about the windows headers redefining -- cgit v1.2.3