diff --git a/uvio/io/buffer.hpp b/uvio/io/buffer.hpp index 34cf1e5..518a87c 100644 --- a/uvio/io/buffer.hpp +++ b/uvio/io/buffer.hpp @@ -1,5 +1,10 @@ #pragma once +#ifdef _WIN32 +// https://github.com/randombit/botan/issues/1852 +#define NOMINMAX 1 +#endif + #include #include #include @@ -62,7 +67,6 @@ class StreamBuffer { } auto write_to(std::span dst) noexcept -> std::size_t { - // MSVC处理\n换行有bug, std::min只能放到同一行 auto n_readable = static_cast(r_remaining()); auto len = std::min(n_readable, dst.size_bytes()); std::copy_n(r_begin(), len, dst.begin()); @@ -74,7 +78,6 @@ class StreamBuffer { } auto read_from(std::span src) noexcept -> std::size_t { - // MSVC处理\n换行有bug, std::min只能放到同一行 auto n_writable = static_cast(w_remaining()); auto len = std::min(n_writable, src.size_bytes()); std::copy_n(src.begin(), len, w_begin());