aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJohannes Schickel2015-02-18 04:52:01 +0100
committerJohannes Schickel2015-02-18 05:24:45 +0100
commit71cc9e41e8e61e560ed5cb8e1fe1d0c539f001be (patch)
treed379df4e0f79bcbaee8b78cb783d9ae6ca4a4671 /backends
parent6ed60538c68a4ec098da30cad39c16770610e5e3 (diff)
downloadscummvm-rg350-71cc9e41e8e61e560ed5cb8e1fe1d0c539f001be.tar.gz
scummvm-rg350-71cc9e41e8e61e560ed5cb8e1fe1d0c539f001be.tar.bz2
scummvm-rg350-71cc9e41e8e61e560ed5cb8e1fe1d0c539f001be.zip
WINCE: Fix compilation.
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/sdl/sdl-sys.h37
-rw-r--r--backends/platform/sdl/sdl-window.cpp2
-rw-r--r--backends/platform/sdl/sdl-window.h2
-rw-r--r--backends/platform/sdl/win32/win32-window.cpp2
-rw-r--r--backends/taskbar/win32/win32-taskbar.cpp3
5 files changed, 37 insertions, 9 deletions
diff --git a/backends/platform/sdl/sdl-sys.h b/backends/platform/sdl/sdl-sys.h
index bc3678e350..59952323f4 100644
--- a/backends/platform/sdl/sdl-sys.h
+++ b/backends/platform/sdl/sdl-sys.h
@@ -52,12 +52,49 @@ typedef struct { int FAKE; } FAKE_FILE;
#define strncasecmp FAKE_strncasecmp
#endif
+// HACK: SDL might include windows.h which defines its own ARRAYSIZE.
+// However, we want to use the version from common/util.h. Thus, we make sure
+// that we actually have this definition after including the SDL headers.
+#if defined(ARRAYSIZE) && defined(COMMON_UTIL_H)
+#define HACK_REDEFINE_ARRAYSIZE
+#undef ARRAYSIZE
+#endif
+
#if defined(__SYMBIAN32__)
#include <esdl\SDL.h>
#else
#include <SDL.h>
#endif
+#include <SDL_syswm.h>
+// SDL_syswm.h will include windows.h on Win32. We need to undefine its
+// ARRAYSIZE definition because we supply our own.
+#undef ARRAYSIZE
+
+#ifdef HACK_REDEFINE_ARRAYSIZE
+#undef HACK_REDEFINE_ARRAYSIZE
+#define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
+#endif
+
+// In a moment of brilliance Xlib.h included by SDL_syswm.h #defines the
+// following names. In a moment of mental breakdown, which occured upon
+// gazing at Xlib.h, LordHoto decided to undefine them to prevent havoc.
+#ifdef Status
+#undef Status
+#endif
+
+#ifdef Bool
+#undef Bool
+#endif
+
+#ifdef True
+#undef True
+#endif
+
+#ifdef False
+#undef False
+#endif
+
// Finally forbid FILE again (if it was forbidden to start with)
#if !defined(FORBIDDEN_SYMBOL_ALLOW_ALL) && !defined(FORBIDDEN_SYMBOL_EXCEPTION_FILE)
#undef FILE
diff --git a/backends/platform/sdl/sdl-window.cpp b/backends/platform/sdl/sdl-window.cpp
index 8dec27d948..2a3877c523 100644
--- a/backends/platform/sdl/sdl-window.cpp
+++ b/backends/platform/sdl/sdl-window.cpp
@@ -28,8 +28,6 @@
#include "icons/scummvm.xpm"
-#include <SDL_syswm.h>
-
SdlWindow::SdlWindow()
#if SDL_VERSION_ATLEAST(2, 0, 0)
: _window(nullptr), _inputGrabState(false), _windowCaption("ScummVM"), _windowIcon(nullptr)
diff --git a/backends/platform/sdl/sdl-window.h b/backends/platform/sdl/sdl-window.h
index cc54673f4c..2608ea4a8f 100644
--- a/backends/platform/sdl/sdl-window.h
+++ b/backends/platform/sdl/sdl-window.h
@@ -27,8 +27,6 @@
#include "common/str.h"
-struct SDL_SysWMinfo;
-
class SdlWindow {
public:
SdlWindow();
diff --git a/backends/platform/sdl/win32/win32-window.cpp b/backends/platform/sdl/win32/win32-window.cpp
index 814c165f6f..de10be6b57 100644
--- a/backends/platform/sdl/win32/win32-window.cpp
+++ b/backends/platform/sdl/win32/win32-window.cpp
@@ -31,8 +31,6 @@
#include <windows.h>
#undef ARRAYSIZE // winnt.h defines ARRAYSIZE, but we want our own one...
-#include <SDL_syswm.h> // For setting the icon
-
void SdlWindow_Win32::setupIcon() {
HMODULE handle = GetModuleHandle(NULL);
HICON ico = LoadIcon(handle, MAKEINTRESOURCE(1001 /* IDI_ICON */));
diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp
index 322ddc4c67..d45253c676 100644
--- a/backends/taskbar/win32/win32-taskbar.cpp
+++ b/backends/taskbar/win32/win32-taskbar.cpp
@@ -48,9 +48,6 @@
#include <shlobj.h>
-// For HWND
-#include <SDL_syswm.h>
-
#include "common/scummsys.h"
#include "backends/taskbar/win32/win32-taskbar.h"