From 4bed2b3ff588452ed754d0758bf9b1b0df0e8c92 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 29 Nov 2010 16:35:29 +0000 Subject: SDL: Trying to cleanup the FORBIDDEN_SYMBOL situation svn-id: r54575 --- backends/platform/sdl/sdl-sys.h | 13 ++++++++++--- backends/platform/sdl/sdl.cpp | 3 --- backends/platform/sdl/win32/win32.cpp | 6 +++--- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'backends/platform/sdl') diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h index 57310807a8..23a25f0a82 100644 --- a/backends/platform/sdl/sdl-sys.h +++ b/backends/platform/sdl/sdl-sys.h @@ -26,16 +26,21 @@ #ifndef BACKEND_SDL_SYS_H #define BACKEND_SDL_SYS_H -// Include the SDL headers, working around the fact that SDL_rwops.h -// uses a FILE pointer in one place, which conflicts with common/forbidden.h +// The purpose of this header is to include the SDL headers in a uniform +// fashion, even on the Symbian port. +// Moreover, it contains a workaround for the fact that SDL_rwops.h uses +// a FILE pointer in one place, which conflicts with common/forbidden.h. + #include "common/scummsys.h" // Remove FILE override from common/forbidden.h, and replace // it with an alternate slightly less unfriendly override. +#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_FILE) #undef FILE typedef struct { int FAKE; } FAKE_FILE; #define FILE FAKE_FILE +#endif #if defined(__SYMBIAN32__) #include @@ -43,8 +48,10 @@ typedef struct { int FAKE; } FAKE_FILE; #include #endif -// Finally forbid FILE again +// Finally forbid FILE again (if it was forbidden to start with) +#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_FILE) #undef FILE #define FILE FORBIDDEN_SYMBOL_REPLACEMENT +#endif #endif diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp index 8d9694b4f7..82ff537c51 100644 --- a/backends/platform/sdl/sdl.cpp +++ b/backends/platform/sdl/sdl.cpp @@ -23,9 +23,6 @@ * */ -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_EXCEPTION_FILE - #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include diff --git a/backends/platform/sdl/win32/win32.cpp b/backends/platform/sdl/win32/win32.cpp index 9723d1f68e..01471e9cb2 100644 --- a/backends/platform/sdl/win32/win32.cpp +++ b/backends/platform/sdl/win32/win32.cpp @@ -23,6 +23,9 @@ * */ +// Disable symbol overrides so that we can use system headers. +#define FORBIDDEN_SYMBOL_ALLOW_ALL + #include "common/scummsys.h" #ifdef WIN32 @@ -31,9 +34,6 @@ #include #undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one... -// Disable symbol overrides so that we can use system headers. -#define FORBIDDEN_SYMBOL_ALLOW_ALL - #include "backends/platform/sdl/win32/win32.h" #include "backends/fs/windows/windows-fs-factory.h" -- cgit v1.2.3