Skip to content

Commit

Permalink
fix ci windows
Browse files Browse the repository at this point in the history
  • Loading branch information
uchenily committed May 16, 2024
1 parent 4b2dde5 commit 71ac950
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions uvio/io/buffer.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#pragma once

#ifdef _WIN32
// https://github.com/randombit/botan/issues/1852
#define NOMINMAX 1
#endif

#include <algorithm>
#include <memory>
#include <span>
Expand Down Expand Up @@ -62,7 +67,6 @@ class StreamBuffer {
}

auto write_to(std::span<char> dst) noexcept -> std::size_t {
// MSVC处理\n换行有bug, std::min只能放到同一行
auto n_readable = static_cast<std::size_t>(r_remaining());
auto len = std::min(n_readable, dst.size_bytes());
std::copy_n(r_begin(), len, dst.begin());
Expand All @@ -74,7 +78,6 @@ class StreamBuffer {
}

auto read_from(std::span<const char> src) noexcept -> std::size_t {
// MSVC处理\n换行有bug, std::min只能放到同一行
auto n_writable = static_cast<std::size_t>(w_remaining());
auto len = std::min(n_writable, src.size_bytes());
std::copy_n(src.begin(), len, w_begin());
Expand Down

0 comments on commit 71ac950

Please sign in to comment.