From 5a16042c8abd5a9182b8cebc81167c902a410c1e Mon Sep 17 00:00:00 2001 From: Marcel Metz Date: Tue, 31 Jan 2012 23:47:01 +0100 Subject: [PATCH] Fixed mingw compile errors. --- src/win32_fullscreen.c | 2 +- src/win32_monitor.c | 5 +++++ src/win32_platform.h | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/win32_fullscreen.c b/src/win32_fullscreen.c index 08f5e93e..682b6757 100644 --- a/src/win32_fullscreen.c +++ b/src/win32_fullscreen.c @@ -229,7 +229,7 @@ int _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, GLFWvidmode* list, int ma } if (list && maxcount) - memcpy(list, vidModes, sizeof(GLFWvidmode) * min(vidModesCount, maxcount)); + memcpy(list, vidModes, sizeof(GLFWvidmode) * ((vidModesCount < maxcount) ? vidModesCount : maxcount)); free(vidModes); diff --git a/src/win32_monitor.c b/src/win32_monitor.c index 506394b0..452b347e 100644 --- a/src/win32_monitor.c +++ b/src/win32_monitor.c @@ -38,6 +38,11 @@ #define EDS_ROTATEDMODE 0x00000004 #endif +// The MinGW upstream lacks this +#ifndef DISPLAY_DEVICE_ACTIVE +#define DISPLAY_DEVICE_ACTIVE 0x00000001 +#endif + ////////////////////////////////////////////////////////////////////////// ////// GLFW platform API ////// diff --git a/src/win32_platform.h b/src/win32_platform.h index 4a1dded8..28eeaf32 100644 --- a/src/win32_platform.h +++ b/src/win32_platform.h @@ -47,7 +47,7 @@ #include #include -#include +#include // This path may need to be changed if you build GLFW using your own setup // We ship and use our own copy of wglext.h since GLFW uses fairly new