From 6de68d7337a4ddb81d293c575e1c8c2a62c7980e Mon Sep 17 00:00:00 2001 From: kichikuou Date: Fri, 20 Jun 2025 08:20:21 +0900 Subject: [PATCH] Windows: Add NOMINMAX compile definition --- CMakeLists.txt | 1 + src/resource.cpp | 2 -- src/sys/nact_input.cpp | 2 -- src/win/mako.cpp | 2 -- src/win/nact_win.cpp | 2 -- 5 files changed, 1 insertion(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b9c589..6c2fa5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,6 +162,7 @@ else() # NOT (ANDROID OR EMSCRIPTEN) src/win/mako.cpp src/win/resource.rc ) + target_compile_definitions(system3 PRIVATE NOMINMAX) target_link_libraries(system3 PRIVATE winmm) if (MINGW) target_link_options(system3 PRIVATE -static) diff --git a/src/resource.cpp b/src/resource.cpp index adbe5af..80d992a 100644 --- a/src/resource.cpp +++ b/src/resource.cpp @@ -2,8 +2,6 @@ #ifdef _WIN32 #include #undef ERROR -#undef min -#undef max #endif #include #include "common.h" diff --git a/src/sys/nact_input.cpp b/src/sys/nact_input.cpp index 06843eb..cd8c7ee 100644 --- a/src/sys/nact_input.cpp +++ b/src/sys/nact_input.cpp @@ -7,8 +7,6 @@ #ifdef _WIN32 #include #undef ERROR -#undef min -#undef max #endif #include #include "nact.h" diff --git a/src/win/mako.cpp b/src/win/mako.cpp index fa02c9d..df6387a 100644 --- a/src/win/mako.cpp +++ b/src/win/mako.cpp @@ -6,8 +6,6 @@ #include #undef ERROR -#undef min -#undef max #include #include #include diff --git a/src/win/nact_win.cpp b/src/win/nact_win.cpp index b5b28c4..6ec9fcf 100644 --- a/src/win/nact_win.cpp +++ b/src/win/nact_win.cpp @@ -1,8 +1,6 @@ #include #include #undef ERROR -#undef min -#undef max #include #include "nact.h" #include "SDL_syswm.h"