diff options
author | Max Horn | 2010-11-29 16:16:50 +0000 |
---|---|---|
committer | Max Horn | 2010-11-29 16:16:50 +0000 |
commit | 4e0e406181a36e5f5ff59e6b917f81f317e1de1a (patch) | |
tree | 1748bdcb0113619f05cc6f603f943753870eacf2 /backends/platform | |
parent | 69c2fc5cebac767283f0f587d92f8842ab9f287b (diff) | |
download | scummvm-rg350-4e0e406181a36e5f5ff59e6b917f81f317e1de1a.tar.gz scummvm-rg350-4e0e406181a36e5f5ff59e6b917f81f317e1de1a.tar.bz2 scummvm-rg350-4e0e406181a36e5f5ff59e6b917f81f317e1de1a.zip |
SDL: Move #include <SDL.h> into a special wrapper file
svn-id: r54572
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/dingux/dingux.h | 1 | ||||
-rw-r--r-- | backends/platform/gph/gph-main.cpp | 6 | ||||
-rwxr-xr-x | backends/platform/openpandora/op-main.cpp | 3 | ||||
-rw-r--r-- | backends/platform/sdl/sdl-sys.h | 50 | ||||
-rw-r--r-- | backends/platform/sdl/sdl.h | 6 | ||||
-rw-r--r-- | backends/platform/wince/CEDevice.cpp | 5 | ||||
-rw-r--r-- | backends/platform/wince/CEgui/GUIElement.cpp | 5 | ||||
-rw-r--r-- | backends/platform/wince/CEgui/PanelKeyboard.cpp | 6 | ||||
-rw-r--r-- | backends/platform/wince/CEgui/SDL_ImageResource.cpp | 5 | ||||
-rw-r--r-- | backends/platform/wince/CEgui/ToolbarHandler.cpp | 6 | ||||
-rw-r--r-- | backends/platform/wince/CEkeys/EventsBuffer.cpp | 5 |
11 files changed, 59 insertions, 39 deletions
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" |