From b76a691bcfed01aefd65722f3d4dcc31f33e5e9e Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 5 Jan 2018 00:09:33 +0000 Subject: [PATCH] 3rdparty(protobuf): fix build with Android NDK 16 --- .../src/google/protobuf/util/field_mask_util.cc | 12 ++++++------ .../src/google/protobuf/util/internal/type_info.cc | 14 +++++++------- .../google/protobuf/util/message_differencer.cc | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/3rdparty/protobuf/src/google/protobuf/util/field_mask_util.cc b/3rdparty/protobuf/src/google/protobuf/util/field_mask_util.cc index 9dfcbd726b..62b29a87fe 100644 --- a/3rdparty/protobuf/src/google/protobuf/util/field_mask_util.cc +++ b/3rdparty/protobuf/src/google/protobuf/util/field_mask_util.cc @@ -216,14 +216,14 @@ class FieldMaskTree { ~Node() { ClearChildren(); } void ClearChildren() { - for (map::iterator it = children.begin(); + for (std::map::iterator it = children.begin(); it != children.end(); ++it) { delete it->second; } children.clear(); } - map children; + std::map children; private: GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Node); @@ -274,7 +274,7 @@ void FieldMaskTree::MergeToFieldMask(const string& prefix, const Node* node, out->add_paths(prefix); return; } - for (map::const_iterator it = node->children.begin(); + for (std::map::const_iterator it = node->children.begin(); it != node->children.end(); ++it) { string current_path = prefix.empty() ? it->first : prefix + "." + it->first; MergeToFieldMask(current_path, it->second, out); @@ -339,7 +339,7 @@ void FieldMaskTree::MergeLeafNodesToTree(const string& prefix, const Node* node, if (node->children.empty()) { out->AddPath(prefix); } - for (map::const_iterator it = node->children.begin(); + for (std::map::const_iterator it = node->children.begin(); it != node->children.end(); ++it) { string current_path = prefix.empty() ? it->first : prefix + "." + it->first; MergeLeafNodesToTree(current_path, it->second, out); @@ -353,7 +353,7 @@ void FieldMaskTree::MergeMessage(const Node* node, const Message& source, const Reflection* source_reflection = source.GetReflection(); const Reflection* destination_reflection = destination->GetReflection(); const Descriptor* descriptor = source.GetDescriptor(); - for (map::const_iterator it = node->children.begin(); + for (std::map::const_iterator it = node->children.begin(); it != node->children.end(); ++it) { const string& field_name = it->first; const Node* child = it->second; @@ -456,7 +456,7 @@ void FieldMaskTree::TrimMessage(const Node* node, Message* message) { const int32 field_count = descriptor->field_count(); for (int index = 0; index < field_count; ++index) { const FieldDescriptor* field = descriptor->field(index); - map::const_iterator it = node->children.find(field->name()); + std::map::const_iterator it = node->children.find(field->name()); if (it == node->children.end()) { reflection->ClearField(message, field); } else { diff --git a/3rdparty/protobuf/src/google/protobuf/util/internal/type_info.cc b/3rdparty/protobuf/src/google/protobuf/util/internal/type_info.cc index 00a8ee7a2a..8201ea629a 100644 --- a/3rdparty/protobuf/src/google/protobuf/util/internal/type_info.cc +++ b/3rdparty/protobuf/src/google/protobuf/util/internal/type_info.cc @@ -60,7 +60,7 @@ class TypeInfoForTypeResolver : public TypeInfo { virtual util::StatusOr ResolveTypeUrl( StringPiece type_url) const { - map::iterator it = cached_types_.find(type_url); + std::map::iterator it = cached_types_.find(type_url); if (it != cached_types_.end()) { return it->second; } @@ -85,7 +85,7 @@ class TypeInfoForTypeResolver : public TypeInfo { virtual const google::protobuf::Enum* GetEnumByTypeUrl( StringPiece type_url) const { - map::iterator it = cached_enums_.find(type_url); + std::map::iterator it = cached_enums_.find(type_url); if (it != cached_enums_.end()) { return it->second.ok() ? it->second.ValueOrDie() : NULL; } @@ -123,8 +123,8 @@ class TypeInfoForTypeResolver : public TypeInfo { typedef util::StatusOr StatusOrEnum; template - static void DeleteCachedTypes(map* cached_types) { - for (typename map::iterator it = cached_types->begin(); + static void DeleteCachedTypes(std::map* cached_types) { + for (typename std::map::iterator it = cached_types->begin(); it != cached_types->end(); ++it) { if (it->second.ok()) { delete it->second.ValueOrDie(); @@ -153,11 +153,11 @@ class TypeInfoForTypeResolver : public TypeInfo { // cached_types_, cached_enums_ and camel_case_name_table_. mutable set string_storage_; - mutable map cached_types_; - mutable map cached_enums_; + mutable std::map cached_types_; + mutable std::map cached_enums_; mutable set indexed_types_; - mutable map camel_case_name_table_; + mutable std::map camel_case_name_table_; }; } // namespace diff --git a/3rdparty/protobuf/src/google/protobuf/util/message_differencer.cc b/3rdparty/protobuf/src/google/protobuf/util/message_differencer.cc index 03a334b6e8..62423be145 100644 --- a/3rdparty/protobuf/src/google/protobuf/util/message_differencer.cc +++ b/3rdparty/protobuf/src/google/protobuf/util/message_differencer.cc @@ -1284,7 +1284,7 @@ class MaximumMatcher { int count1_; int count2_; google::protobuf::scoped_ptr match_callback_; - map, bool> cached_match_results_; + std::map, bool> cached_match_results_; vector* match_list1_; vector* match_list2_; GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MaximumMatcher); @@ -1322,7 +1322,7 @@ int MaximumMatcher::FindMaximumMatch(bool early_return) { bool MaximumMatcher::Match(int left, int right) { pair p(left, right); - map, bool>::iterator it = cached_match_results_.find(p); + std::map, bool>::iterator it = cached_match_results_.find(p); if (it != cached_match_results_.end()) { return it->second; }