aboutsummaryrefslogtreecommitdiff
path: root/backends/midi/alsa.cpp
diff options
context:
space:
mode:
authorMax Horn2010-10-30 21:27:42 +0000
committerMax Horn2010-10-30 21:27:42 +0000
commit44393b2dc8ba78342dcbb7df39eca2e9e1f6e429 (patch)
treeb5b2d7013d64ca317072453a7fbbc391174e2851 /backends/midi/alsa.cpp
parentff34a778318355ffba2ee5700524fccba9fe5cf3 (diff)
downloadscummvm-rg350-44393b2dc8ba78342dcbb7df39eca2e9e1f6e429.tar.gz
scummvm-rg350-44393b2dc8ba78342dcbb7df39eca2e9e1f6e429.tar.bz2
scummvm-rg350-44393b2dc8ba78342dcbb7df39eca2e9e1f6e429.zip
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
Diffstat (limited to 'backends/midi/alsa.cpp')
-rw-r--r--backends/midi/alsa.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/backends/midi/alsa.cpp b/backends/midi/alsa.cpp
index 4f73d7384b..fd32777a1b 100644
--- a/backends/midi/alsa.cpp
+++ b/backends/midi/alsa.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(USE_ALSA)