diff options
Diffstat (limited to 'src/google/protobuf/map.h')
-rw-r--r-- | src/google/protobuf/map.h | 12 |
1 files changed, 7 insertions, 5 deletions
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<Key> 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 <class InputIt> - 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<size_type>::max(); + // parentheses around (std::...:max) prevents macro warning of max() + return (std::numeric_limits<size_type>::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; } |