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
This commit is contained in:
parent
ff34a77831
commit
44393b2dc8
21 changed files with 214 additions and 8 deletions
|
@ -23,6 +23,9 @@
|
|||
*
|
||||
*/
|
||||
|
||||
// Disable symbol overrides so that we can use system headers.
|
||||
#define FORBIDDEN_SYMBOL_ALLOW_ALL
|
||||
|
||||
#if defined(WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
@ -79,7 +82,7 @@
|
|||
#endif
|
||||
|
||||
#if defined(MACOSX) || defined(IPHONE)
|
||||
#include "CoreFoundation/CoreFoundation.h"
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue