From 5a76e633ea9b5adb215e93fdc11e1c0c08b3fc74 Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Thu, 17 Nov 2016 16:48:38 -0800 Subject: Integrated internal changes from Google --- src/google/protobuf/map.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/google/protobuf/map.h') diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 2d295510..efd421e6 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -523,13 +523,13 @@ class Map { typedef size_t size_type; typedef hash hasher; - explicit Map(bool old_style = true) + explicit Map(bool old_style = false) : arena_(NULL), default_enum_value_(0), old_style_(old_style) { Init(); } - explicit Map(Arena* arena, bool old_style = true) + explicit Map(Arena* arena, bool old_style = false) : arena_(arena), default_enum_value_(0), old_style_(old_style) { @@ -543,7 +543,7 @@ class Map { insert(other.begin(), other.end()); } template - Map(const InputIt& first, const InputIt& last, bool old_style = true) + Map(const InputIt& first, const InputIt& last, bool old_style = false) : arena_(NULL), default_enum_value_(0), old_style_(old_style) { @@ -654,7 +654,8 @@ class Map { // To support Visual Studio 2008 size_type max_size() const { - return std::numeric_limits::max(); + // parentheses around (std::...:max) prevents macro warning of max() + return (std::numeric_limits::max)(); } // To support gcc-4.4, which does not properly @@ -1084,8 +1085,9 @@ class Map { // index_of_first_non_null_, so we skip the code to update it. return InsertUniqueInTree(b, node); } + // parentheses around (std::min) prevents macro expansion of min(...) index_of_first_non_null_ = - std::min(index_of_first_non_null_, result.bucket_index_); + (std::min)(index_of_first_non_null_, result.bucket_index_); return result; } -- cgit v1.2.3