SDL: Move #include <SDL.h> into a special wrapper file

svn-id: r54572
This commit is contained in:
Max Horn 2010-11-29 16:16:50 +00:00
parent 69c2fc5ceb
commit 4e0e406181
20 changed files with 69 additions and 80 deletions

View file

@ -28,11 +28,7 @@
#include "backends/audiocd/default/default-audiocd.h" #include "backends/audiocd/default/default-audiocd.h"
#if defined(__SYMBIAN32__) #include "backends/platform/sdl/sdl-sys.h"
#include <esdl\SDL.h>
#else
#include <SDL.h>
#endif
/** /**
* The SDL audio cd manager. Implements real audio cd playback. * The SDL audio cd manager. Implements real audio cd playback.

View file

@ -28,11 +28,8 @@
#include "backends/events/default/default-events.h" #include "backends/events/default/default-events.h"
#if defined(__SYMBIAN32__) #include "backends/platform/sdl/sdl-sys.h"
#include <esdl\SDL.h>
#else
#include <SDL.h>
#endif
/** /**
* The SDL event source. * The SDL event source.

View file

@ -26,7 +26,7 @@
#ifndef BACKENDS_GRAPHICS_OPENGLSDL_H #ifndef BACKENDS_GRAPHICS_OPENGLSDL_H
#define BACKENDS_GRAPHICS_OPENGLSDL_H #define BACKENDS_GRAPHICS_OPENGLSDL_H
#include <SDL.h> #include "backends/platform/sdl/sdl-sys.h"
#if defined(ARRAYSIZE) && !defined(_WINDOWS_) #if defined(ARRAYSIZE) && !defined(_WINDOWS_)
#undef ARRAYSIZE #undef ARRAYSIZE
#endif #endif

View file

@ -25,9 +25,6 @@
#if defined(SDL_BACKEND) #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/graphics/sdl/sdl-graphics.h"
#include "backends/events/sdl/sdl-events.h" #include "backends/events/sdl/sdl-events.h"
#include "backends/platform/sdl/sdl.h" #include "backends/platform/sdl/sdl.h"

View file

@ -33,11 +33,8 @@
#include "backends/events/sdl/sdl-events.h" #include "backends/events/sdl/sdl-events.h"
#if defined(__SYMBIAN32__) #include "backends/platform/sdl/sdl-sys.h"
#include <esdl\SDL.h>
#else
#include <SDL.h>
#endif
#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__) #if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
// Uncomment this to enable the 'on screen display' code. // Uncomment this to enable the 'on screen display' code.

View file

@ -26,12 +26,7 @@
#ifndef BACKENDS_MIXER_SDL_H #ifndef BACKENDS_MIXER_SDL_H
#define BACKENDS_MIXER_SDL_H #define BACKENDS_MIXER_SDL_H
#if defined(__SYMBIAN32__) #include "backends/platform/sdl/sdl-sys.h"
#include <esdl\SDL.h>
#else
#include <SDL.h>
#endif
#include "sound/mixer_intern.h" #include "sound/mixer_intern.h"
/** /**

View file

@ -25,16 +25,9 @@
#if defined(SDL_BACKEND) #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/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() { OSystem::MutexRef SdlMutexManager::createMutex() {
return (OSystem::MutexRef) SDL_CreateMutex(); return (OSystem::MutexRef) SDL_CreateMutex();

View file

@ -28,7 +28,6 @@
#if defined(DINGUX) #if defined(DINGUX)
#include <SDL.h>
#include "backends/base-backend.h" #include "backends/base-backend.h"
#include "backends/platform/sdl/sdl.h" #include "backends/platform/sdl/sdl.h"
#include "backends/platform/sdl/posix/posix.h" #include "backends/platform/sdl/posix/posix.h"

View file

@ -23,11 +23,7 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers. #include "backends/platform/sdl/sdl-sys.h"
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "common/scummsys.h"
#include <SDL/SDL.h>
// #include "backends/platform/gph/gph-options.h" // #include "backends/platform/gph/gph-options.h"
#include "backends/platform/gph/gph-sdl.h" #include "backends/platform/gph/gph-sdl.h"

View file

@ -26,8 +26,7 @@
// Disable symbol overrides so that we can use system headers. // Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL #define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "common/scummsys.h" #include "backends/platform/sdl/sdl-sys.h"
#include <SDL/SDL.h>
#include "backends/platform/openpandora/op-sdl.h" #include "backends/platform/openpandora/op-sdl.h"
#include "backends/plugins/posix/posix-provider.h" #include "backends/plugins/posix/posix-provider.h"

View file

@ -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

View file

@ -26,11 +26,7 @@
#ifndef PLATFORM_SDL_H #ifndef PLATFORM_SDL_H
#define PLATFORM_SDL_H #define PLATFORM_SDL_H
#if defined(__SYMBIAN32__) #include "backends/platform/sdl/sdl-sys.h"
#include <esdl\SDL.h>
#else
#include <SDL.h>
#endif
#include "backends/modular-backend.h" #include "backends/modular-backend.h"
#include "backends/mixer/sdl/sdl-mixer.h" #include "backends/mixer/sdl/sdl-mixer.h"

View file

@ -23,12 +23,9 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers.
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "CEDevice.h" #include "CEDevice.h"
#include <SDL.h> #include "backends/platform/sdl/sdl-sys.h"
#include "backends/platform/wince/wince-sdl.h" #include "backends/platform/wince/wince-sdl.h"

View file

@ -23,10 +23,7 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers. #include "backends/platform/sdl/sdl-sys.h"
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <SDL.h>
#include "Toolbar.h" #include "Toolbar.h"

View file

@ -23,11 +23,7 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers. #include "backends/platform/sdl/sdl-sys.h"
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <SDL.h>
#include "PanelKeyboard.h" #include "PanelKeyboard.h"
namespace CEGUI { namespace CEGUI {

View file

@ -23,10 +23,7 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers. #include "backends/platform/sdl/sdl-sys.h"
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include "SDL.h"
#include "SDL_ImageResource.h" #include "SDL_ImageResource.h"
namespace CEGUI { namespace CEGUI {

View file

@ -23,11 +23,7 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers. #include "backends/platform/sdl/sdl-sys.h"
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <SDL.h>
#include "ToolbarHandler.h" #include "ToolbarHandler.h"
namespace CEGUI { namespace CEGUI {

View file

@ -23,10 +23,7 @@
* *
*/ */
// Disable symbol overrides so that we can use system headers. #include "backends/platform/sdl/sdl-sys.h"
#define FORBIDDEN_SYMBOL_ALLOW_ALL
#include <SDL.h>
#include "EventsBuffer.h" #include "EventsBuffer.h"

View file

@ -32,9 +32,7 @@
#include "backends/plugins/dynamic-plugin.h" #include "backends/plugins/dynamic-plugin.h"
#include "common/fs.h" #include "common/fs.h"
#include "SDL.h" #include "backends/platform/sdl/sdl-sys.h"
#include "SDL_loadso.h"
class SDLPlugin : public DynamicPlugin { class SDLPlugin : public DynamicPlugin {
protected: protected:

View file

@ -28,11 +28,7 @@
#include "backends/timer/default/default-timer.h" #include "backends/timer/default/default-timer.h"
#if defined(__SYMBIAN32__) #include "backends/platform/sdl/sdl-sys.h"
#include <esdl\SDL.h>
#else
#include <SDL.h>
#endif
/** /**
* SDL timer manager. Setups the timer callback for * SDL timer manager. Setups the timer callback for