From d0d2332193a1152b84d708691b3512dff6decece Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 10 Feb 2014 21:12:20 +0100 Subject: [PATCH] WINVER fixes for MinGW and VC++. --- CMakeLists.txt | 5 +++-- src/win32_platform.h | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d10f10dc..22a3ef36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,8 +175,9 @@ if (_GLFW_WIN32) # the inclusion of stddef.h (by glfw3.h), which is itself included before # win32_platform.h. We define them here until a saner solution can be found # NOTE: MinGW-w64 and Visual C++ do /not/ need this hack. - add_definitions(-DUNICODE) - add_definitions(-DWINVER=0x0501) + if (CMAKE_COMPILER_IS_GNUC) + add_definitions(-DUNICODE -DWINVER=0x0501) + endif() endif() #-------------------------------------------------------------------- diff --git a/src/win32_platform.h b/src/win32_platform.h index c0395bb9..ce80e4d8 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -80,17 +80,18 @@ #ifndef WM_COPYGLOBALDATA #define WM_COPYGLOBALDATA 0x0049 #endif -#ifndef MSGFLT_ALLOW - #define MSGFLT_ALLOW 1 -#endif -#if defined(__MINGW32__) +#if WINVER < 0x0601 typedef struct tagCHANGEFILTERSTRUCT { DWORD cbSize; DWORD ExtStatus; + } CHANGEFILTERSTRUCT, *PCHANGEFILTERSTRUCT; -#endif /*__MINGW32__*/ +#ifndef MSGFLT_ALLOW + #define MSGFLT_ALLOW 1 +#endif +#endif /*Windows 7*/ //========================================================================