aboutsummaryrefslogtreecommitdiff
path: root/backends/taskbar/win32
diff options
context:
space:
mode:
authorJohannes Schickel2016-02-12 18:18:46 +0100
committerJohannes Schickel2016-02-12 19:22:47 +0100
commit655f4dfedbb2b3ca8600777eb1011bb1df0ecf79 (patch)
tree3151ad63fc2238e902f259ffc5c4197b09ae6506 /backends/taskbar/win32
parent5e114dfa9ffb46d51616ee7d45f8a0fcb2e918e2 (diff)
downloadscummvm-rg350-655f4dfedbb2b3ca8600777eb1011bb1df0ecf79.tar.gz
scummvm-rg350-655f4dfedbb2b3ca8600777eb1011bb1df0ecf79.tar.bz2
scummvm-rg350-655f4dfedbb2b3ca8600777eb1011bb1df0ecf79.zip
WIN32: Fix compilation with MinGW-w64 based Win32 compiler.
Diffstat (limited to 'backends/taskbar/win32')
-rw-r--r--backends/taskbar/win32/win32-taskbar.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp
index 0192b1dc03..f3339fb917 100644
--- a/backends/taskbar/win32/win32-taskbar.cpp
+++ b/backends/taskbar/win32/win32-taskbar.cpp
@@ -28,8 +28,22 @@
#if defined(WIN32) && defined(USE_TASKBAR)
+// HACK: To get __MINGW64_VERSION_foo defines we need to manually include
+// _mingw.h in this file because we do not include any system headers at this
+// point on purpose. The defines are required to detect whether this is a
+// classic MinGW toolchain or a MinGW-w64 based one.
+#if defined(__MINGW32__)
+#include <_mingw.h>
+#endif
+
// Needed for taskbar functions
-#if defined(__GNUC__) && defined(__MINGW32__) && !defined(__MINGW64__)
+// HACK: MinGW-w64 based toolchains include the symbols we require in their
+// headers. The 32 bit incarnation only defines __MINGW32__. This leads to
+// build breakage due to clashes with our compat header. Luckily MinGW-w64
+// based toolchains define __MINGW64_VERSION_foo macros inside _mingw.h,
+// which is included from all system headers. Thus we abuse that to detect
+// them.
+#if defined(__GNUC__) && defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
#include "backends/taskbar/win32/mingw-compat.h"
#else
// We use functionality introduced with Win7 in this file.