Don't have Windows headers define min/max, in case they're defined by application code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
diff --git a/include/SDL_egl.h b/include/SDL_egl.h
index f50fa5c..f95a906 100644
--- a/include/SDL_egl.h
+++ b/include/SDL_egl.h
@@ -390,6 +390,9 @@ typedef enum {
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
+#ifndef NOMINMAX /* don't define min() and max(). */
+#define NOMINMAX
+#endif
#include <windows.h>
#if __WINRT__
diff --git a/include/SDL_opengl_glext.h b/include/SDL_opengl_glext.h
index cd3869f..6a402b1 100644
--- a/include/SDL_opengl_glext.h
+++ b/include/SDL_opengl_glext.h
@@ -40,6 +40,9 @@ extern "C" {
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN 1
#endif
+#ifndef NOMINMAX /* don't define min() and max(). */
+#define NOMINMAX
+#endif
#include <windows.h>
#endif
diff --git a/include/SDL_syswm.h b/include/SDL_syswm.h
index 7aa8c68..1469b23 100644
--- a/include/SDL_syswm.h
+++ b/include/SDL_syswm.h
@@ -49,6 +49,9 @@ struct SDL_SysWMinfo;
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
+#ifndef NOMINMAX /* don't define min() and max(). */
+#define NOMINMAX
+#endif
#include <windows.h>
#endif