From 1d457a0271ec4b2ddf73e52a13c856ed939efde0 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 27 Nov 2015 20:06:41 +0000 Subject: [PATCH] Fix use of std::max when Windows.h is imported. --- include/flatbuffers/flatbuffers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index c2b938d36..2af4486c7 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -445,7 +445,7 @@ class vector_downward { if (len > static_cast(cur_ - buf_)) { auto old_size = size(); auto largest_align = AlignOf(); - 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_);