From: Kang Lin Date: Thu, 25 Jul 2024 03:32:48 +0000 (+0800) Subject: Use std::min replace min X-Git-Tag: v1.14.1~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=128b30f939ebe90ee3cbb24e2f62a231a9c8df09;p=tigervnc.git Use std::min replace min (cherry picked from commit 9aaea93b2d1012b05ea24a15f4269cb9f356c3d9) --- diff --git a/common/rdr/CMakeLists.txt b/common/rdr/CMakeLists.txt index 30c2403a..2897119b 100644 --- a/common/rdr/CMakeLists.txt +++ b/common/rdr/CMakeLists.txt @@ -20,6 +20,11 @@ target_include_directories(rdr PUBLIC ${CMAKE_SOURCE_DIR}/common) target_include_directories(rdr SYSTEM PUBLIC ${ZLIB_INCLUDE_DIRS}) target_link_libraries(rdr ${ZLIB_LIBRARIES} os rfb) +if(MSVC) + # undef min and max macro + target_compile_definitions(rfb PRIVATE NOMINMAX) +endif() + if(GNUTLS_FOUND) target_include_directories(rdr SYSTEM PUBLIC ${GNUTLS_INCLUDE_DIR}) target_link_libraries(rdr ${GNUTLS_LIBRARIES}) diff --git a/common/rdr/HexInStream.cxx b/common/rdr/HexInStream.cxx index e23974e1..11f98498 100644 --- a/common/rdr/HexInStream.cxx +++ b/common/rdr/HexInStream.cxx @@ -21,14 +21,13 @@ #include #endif +#include #include #include #include using namespace rdr; -static inline int min(int a, int b) {return a #endif - +#include #include #include using namespace rdr; -static inline size_t min(size_t a, size_t b) {return a