aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/audiocd/sdl/sdl-audiocd.h6
-rw-r--r--backends/events/sdl/sdl-events.h7
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.h2
-rw-r--r--backends/graphics/sdl/sdl-graphics.cpp3
-rw-r--r--backends/graphics/sdl/sdl-graphics.h7
-rw-r--r--backends/mixer/sdl/sdl-mixer.h7
-rw-r--r--backends/mutex/sdl/sdl-mutex.cpp9
-rw-r--r--backends/platform/dingux/dingux.h1
-rw-r--r--backends/platform/gph/gph-main.cpp6
-rwxr-xr-xbackends/platform/openpandora/op-main.cpp3
-rw-r--r--backends/platform/sdl/sdl-sys.h50
-rw-r--r--backends/platform/sdl/sdl.h6
-rw-r--r--backends/platform/wince/CEDevice.cpp5
-rw-r--r--backends/platform/wince/CEgui/GUIElement.cpp5
-rw-r--r--backends/platform/wince/CEgui/PanelKeyboard.cpp6
-rw-r--r--backends/platform/wince/CEgui/SDL_ImageResource.cpp5
-rw-r--r--backends/platform/wince/CEgui/ToolbarHandler.cpp6
-rw-r--r--backends/platform/wince/CEkeys/EventsBuffer.cpp5
-rw-r--r--backends/plugins/sdl/sdl-provider.cpp4
-rw-r--r--backends/timer/sdl/sdl-timer.h6
20 files changed, 69 insertions, 80 deletions
diff --git a/backends/audiocd/sdl/sdl-audiocd.h b/backends/audiocd/sdl/sdl-audiocd.h
index 42ac980c51..b46afab9f2 100644
--- a/backends/audiocd/sdl/sdl-audiocd.h
+++ b/backends/audiocd/sdl/sdl-audiocd.h
@@ -28,11 +28,7 @@
#include "backends/audiocd/default/default-audiocd.h"
-#if defined(__SYMBIAN32__)
-#include <esdl\SDL.h>
-#else
-#include <SDL.h>
-#endif
+#include "backends/platform/sdl/sdl-sys.h"
/**
* The SDL audio cd manager. Implements real audio cd playback.
diff --git a/backends/events/sdl/sdl-events.h b/backends/events/sdl/sdl-events.h
index ab6a64d7ef..436635f78a 100644
--- a/backends/events/sdl/sdl-events.h
+++ b/backends/events/sdl/sdl-events.h
@@ -28,11 +28,8 @@
#include "backends/events/default/default-events.h"
-#if defined(__SYMBIAN32__)
-#include <esdl\SDL.h>
-#else
-#include <SDL.h>
-#endif
+#include "backends/platform/sdl/sdl-sys.h"
+
/**
* The SDL event source.
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h
index 0854872315..548988e43a 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.h
+++ b/backends/graphics/openglsdl/openglsdl-graphics.h
@@ -26,7 +26,7 @@
#ifndef BACKENDS_GRAPHICS_OPENGLSDL_H
#define BACKENDS_GRAPHICS_OPENGLSDL_H
-#include <SDL.h>
+#include "backends/platform/sdl/sdl-sys.h"
#if defined(ARRAYSIZE) && !defined(_WINDOWS_)
#undef ARRAYSIZE
#endif
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 4982336e9f..226285c593 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -25,9 +25,6 @@
#if defined(SDL_BACKEND)
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
-
#include "backends/graphics/sdl/sdl-graphics.h"
#include "backends/events/sdl/sdl-events.h"
#include "backends/platform/sdl/sdl.h"
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index 62f87ee238..6a55a3d489 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -33,11 +33,8 @@
#include "backends/events/sdl/sdl-events.h"
-#if defined(__SYMBIAN32__)
-#include <esdl\SDL.h>
-#else
-#include <SDL.h>
-#endif
+#include "backends/platform/sdl/sdl-sys.h"
+
#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
// Uncomment this to enable the 'on screen display' code.
diff --git a/backends/mixer/sdl/sdl-mixer.h b/backends/mixer/sdl/sdl-mixer.h
index ca0cbbf93f..42129358aa 100644
--- a/backends/mixer/sdl/sdl-mixer.h
+++ b/backends/mixer/sdl/sdl-mixer.h
@@ -26,12 +26,7 @@
#ifndef BACKENDS_MIXER_SDL_H
#define BACKENDS_MIXER_SDL_H
-#if defined(__SYMBIAN32__)
-#include <esdl\SDL.h>
-#else
-#include <SDL.h>
-#endif
-
+#include "backends/platform/sdl/sdl-sys.h"
#include "sound/mixer_intern.h"
/**
diff --git a/backends/mutex/sdl/sdl-mutex.cpp b/backends/mutex/sdl/sdl-mutex.cpp
index 46ce269417..3c572a94d5 100644
--- a/backends/mutex/sdl/sdl-mutex.cpp
+++ b/backends/mutex/sdl/sdl-mutex.cpp
@@ -25,16 +25,9 @@
#if defined(SDL_BACKEND)
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_EXCEPTION_FILE
-
#include "backends/mutex/sdl/sdl-mutex.h"
+#include "backends/platform/sdl/sdl-sys.h"
-#if defined(__SYMBIAN32__)
-#include <esdl\SDL.h>
-#else
-#include <SDL.h>
-#endif
OSystem::MutexRef SdlMutexManager::createMutex() {
return (OSystem::MutexRef) SDL_CreateMutex();
diff --git a/backends/platform/dingux/dingux.h b/backends/platform/dingux/dingux.h
index b56787528b..2db2272f4f 100644
--- a/backends/platform/dingux/dingux.h
+++ b/backends/platform/dingux/dingux.h
@@ -28,7 +28,6 @@
#if defined(DINGUX)
-#include <SDL.h>
#include "backends/base-backend.h"
#include "backends/platform/sdl/sdl.h"
#include "backends/platform/sdl/posix/posix.h"
diff --git a/backends/platform/gph/gph-main.cpp b/backends/platform/gph/gph-main.cpp
index 8144bffb8f..efb71040f5 100644
--- a/backends/platform/gph/gph-main.cpp
+++ b/backends/platform/gph/gph-main.cpp
@@ -23,11 +23,7 @@
*
*/
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
-#include "common/scummsys.h"
-#include <SDL/SDL.h>
+#include "backends/platform/sdl/sdl-sys.h"
// #include "backends/platform/gph/gph-options.h"
#include "backends/platform/gph/gph-sdl.h"
diff --git a/backends/platform/openpandora/op-main.cpp b/backends/platform/openpandora/op-main.cpp
index 3f4208a95a..8b181ef3b0 100755
--- a/backends/platform/openpandora/op-main.cpp
+++ b/backends/platform/openpandora/op-main.cpp
@@ -26,8 +26,7 @@
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
-#include "common/scummsys.h"
-#include <SDL/SDL.h>
+#include "backends/platform/sdl/sdl-sys.h"
#include "backends/platform/openpandora/op-sdl.h"
#include "backends/plugins/posix/posix-provider.h"
diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h
new file mode 100644
index 0000000000..57310807a8
--- /dev/null
+++ b/backends/platform/sdl/sdl-sys.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#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
+
+#include "common/scummsys.h"
+
+// Remove FILE override from common/forbidden.h, and replace
+// it with an alternate slightly less unfriendly override.
+#undef FILE
+typedef struct { int FAKE; } FAKE_FILE;
+#define FILE FAKE_FILE
+
+#if defined(__SYMBIAN32__)
+#include <esdl\SDL.h>
+#else
+#include <SDL.h>
+#endif
+
+// Finally forbid FILE again
+#undef FILE
+#define FILE FORBIDDEN_SYMBOL_REPLACEMENT
+
+#endif
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 7c82159d40..72bbda0600 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -26,11 +26,7 @@
#ifndef PLATFORM_SDL_H
#define PLATFORM_SDL_H
-#if defined(__SYMBIAN32__)
-#include <esdl\SDL.h>
-#else
-#include <SDL.h>
-#endif
+#include "backends/platform/sdl/sdl-sys.h"
#include "backends/modular-backend.h"
#include "backends/mixer/sdl/sdl-mixer.h"
diff --git a/backends/platform/wince/CEDevice.cpp b/backends/platform/wince/CEDevice.cpp
index 08acbbbfcd..d94ce6cde7 100644
--- a/backends/platform/wince/CEDevice.cpp
+++ b/backends/platform/wince/CEDevice.cpp
@@ -23,12 +23,9 @@
*
*/
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
#include "CEDevice.h"
-#include <SDL.h>
+#include "backends/platform/sdl/sdl-sys.h"
#include "backends/platform/wince/wince-sdl.h"
diff --git a/backends/platform/wince/CEgui/GUIElement.cpp b/backends/platform/wince/CEgui/GUIElement.cpp
index 7689837e3d..dd463c22a1 100644
--- a/backends/platform/wince/CEgui/GUIElement.cpp
+++ b/backends/platform/wince/CEgui/GUIElement.cpp
@@ -23,10 +23,7 @@
*
*/
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
-#include <SDL.h>
+#include "backends/platform/sdl/sdl-sys.h"
#include "Toolbar.h"
diff --git a/backends/platform/wince/CEgui/PanelKeyboard.cpp b/backends/platform/wince/CEgui/PanelKeyboard.cpp
index 1b2a478746..5ca125898d 100644
--- a/backends/platform/wince/CEgui/PanelKeyboard.cpp
+++ b/backends/platform/wince/CEgui/PanelKeyboard.cpp
@@ -23,11 +23,7 @@
*
*/
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
-#include <SDL.h>
-
+#include "backends/platform/sdl/sdl-sys.h"
#include "PanelKeyboard.h"
namespace CEGUI {
diff --git a/backends/platform/wince/CEgui/SDL_ImageResource.cpp b/backends/platform/wince/CEgui/SDL_ImageResource.cpp
index 567013b5ff..8dad5f0a0c 100644
--- a/backends/platform/wince/CEgui/SDL_ImageResource.cpp
+++ b/backends/platform/wince/CEgui/SDL_ImageResource.cpp
@@ -23,10 +23,7 @@
*
*/
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
-#include "SDL.h"
+#include "backends/platform/sdl/sdl-sys.h"
#include "SDL_ImageResource.h"
namespace CEGUI {
diff --git a/backends/platform/wince/CEgui/ToolbarHandler.cpp b/backends/platform/wince/CEgui/ToolbarHandler.cpp
index f74d24ad25..78f69119c3 100644
--- a/backends/platform/wince/CEgui/ToolbarHandler.cpp
+++ b/backends/platform/wince/CEgui/ToolbarHandler.cpp
@@ -23,11 +23,7 @@
*
*/
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
-#include <SDL.h>
-
+#include "backends/platform/sdl/sdl-sys.h"
#include "ToolbarHandler.h"
namespace CEGUI {
diff --git a/backends/platform/wince/CEkeys/EventsBuffer.cpp b/backends/platform/wince/CEkeys/EventsBuffer.cpp
index 3cdcb44173..c9f4af2304 100644
--- a/backends/platform/wince/CEkeys/EventsBuffer.cpp
+++ b/backends/platform/wince/CEkeys/EventsBuffer.cpp
@@ -23,10 +23,7 @@
*
*/
-// Disable symbol overrides so that we can use system headers.
-#define FORBIDDEN_SYMBOL_ALLOW_ALL
-
-#include <SDL.h>
+#include "backends/platform/sdl/sdl-sys.h"
#include "EventsBuffer.h"
diff --git a/backends/plugins/sdl/sdl-provider.cpp b/backends/plugins/sdl/sdl-provider.cpp
index 6f8ca594f6..46e00de453 100644
--- a/backends/plugins/sdl/sdl-provider.cpp
+++ b/backends/plugins/sdl/sdl-provider.cpp
@@ -32,9 +32,7 @@
#include "backends/plugins/dynamic-plugin.h"
#include "common/fs.h"
-#include "SDL.h"
-#include "SDL_loadso.h"
-
+#include "backends/platform/sdl/sdl-sys.h"
class SDLPlugin : public DynamicPlugin {
protected:
diff --git a/backends/timer/sdl/sdl-timer.h b/backends/timer/sdl/sdl-timer.h
index 5995aed4b0..8c609d728d 100644
--- a/backends/timer/sdl/sdl-timer.h
+++ b/backends/timer/sdl/sdl-timer.h
@@ -28,11 +28,7 @@
#include "backends/timer/default/default-timer.h"
-#if defined(__SYMBIAN32__)
-#include <esdl\SDL.h>
-#else
-#include <SDL.h>
-#endif
+#include "backends/platform/sdl/sdl-sys.h"
/**
* SDL timer manager. Setups the timer callback for