Commit 1d457a02 authored by Chris's avatar Chris Committed by Wouter van Oortmerssen

Fix use of std::max when Windows.h is imported.

parent 671c9495
......@@ -445,7 +445,7 @@ class vector_downward {
if (len > static_cast<size_t>(cur_ - buf_)) {
auto old_size = size();
auto largest_align = AlignOf<largest_scalar_t>();
reserved_ += std::max(len, growth_policy(reserved_));
reserved_ += (std::max)(len, growth_policy(reserved_));
// Round up to avoid undefined behavior from unaligned loads and stores.
reserved_ = (reserved_ + (largest_align - 1)) & ~(largest_align - 1);
auto new_buf = allocator_.allocate(reserved_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment