From 7c81098569ac9c546ef845dfd0ba094b5a837c2f Mon Sep 17 00:00:00 2001 From: Flaviu_ <37621568+flaviu22@users.noreply.github.com> Date: Fri, 9 Feb 2024 13:48:58 +0200 Subject: [PATCH] Update zip_file.hpp Solve Windows error --- zip_file.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zip_file.hpp b/zip_file.hpp index c324f70..e8b91c0 100644 --- a/zip_file.hpp +++ b/zip_file.hpp @@ -5621,7 +5621,11 @@ class zip_file { if(!comment.empty()) { - auto comment_length = std::min(static_cast(comment.length()), std::numeric_limits::max()); +#ifdef _WIN32 + auto comment_length = (std::min)(static_cast(comment.length()), (std::numeric_limits::max)()); +#else + auto comment_length = std::min(static_cast(comment.length()), std::numeric_limits::max()); +#endif buffer_[buffer_.size() - 2] = static_cast(comment_length); buffer_[buffer_.size() - 1] = static_cast(comment_length >> 8); std::copy(comment.begin(), comment.end(), std::back_inserter(buffer_));