aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake.lua2
-rw-r--r--zencore/include/zencore/windows.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/xmake.lua b/xmake.lua
index cb70c34ea..84aaceacc 100644
--- a/xmake.lua
+++ b/xmake.lua
@@ -44,6 +44,8 @@ if is_os("windows") then
"_UNICODE",
"UNICODE",
"_CONSOLE",
+ "NOMINMAX", -- stop Windows SDK defining 'min' and 'max'
+ "WIN32_LEAN_AND_MEAN", -- cut down Windows.h
"_WIN32_WINNT=0x0A00"
)
-- add_ldflags("/MAP")
diff --git a/zencore/include/zencore/windows.h b/zencore/include/zencore/windows.h
index 68138566b..417d473e0 100644
--- a/zencore/include/zencore/windows.h
+++ b/zencore/include/zencore/windows.h
@@ -10,7 +10,9 @@ struct IUnknown; // Workaround for "combaseapi.h(229): error C2187: syntax erro
#ifndef NOMINMAX
# define NOMINMAX // We don't want your min/max macros
#endif
-#define WIN32_LEAN_AND_MEAN
+#ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
#undef GetObject