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_));