3rdparty(protobuf): fix build with Android NDK 16

This commit is contained in:
Alexander Alekhin 2018-01-05 00:09:33 +00:00
parent bc6a355370
commit b76a691bcf
3 changed files with 15 additions and 15 deletions

View File

@ -216,14 +216,14 @@ class FieldMaskTree {
~Node() { ClearChildren(); }
void ClearChildren() {
for (map<string, Node*>::iterator it = children.begin();
for (std::map<string, Node*>::iterator it = children.begin();
it != children.end(); ++it) {
delete it->second;
}
children.clear();
}
map<string, Node*> children;
std::map<string, Node*> 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<string, Node*>::const_iterator it = node->children.begin();
for (std::map<string, Node*>::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<string, Node*>::const_iterator it = node->children.begin();
for (std::map<string, Node*>::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<string, Node*>::const_iterator it = node->children.begin();
for (std::map<string, Node*>::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<string, Node*>::const_iterator it = node->children.find(field->name());
std::map<string, Node*>::const_iterator it = node->children.find(field->name());
if (it == node->children.end()) {
reflection->ClearField(message, field);
} else {

View File

@ -60,7 +60,7 @@ class TypeInfoForTypeResolver : public TypeInfo {
virtual util::StatusOr<const google::protobuf::Type*> ResolveTypeUrl(
StringPiece type_url) const {
map<StringPiece, StatusOrType>::iterator it = cached_types_.find(type_url);
std::map<StringPiece, StatusOrType>::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<StringPiece, StatusOrEnum>::iterator it = cached_enums_.find(type_url);
std::map<StringPiece, StatusOrEnum>::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<const google::protobuf::Enum*> StatusOrEnum;
template <typename T>
static void DeleteCachedTypes(map<StringPiece, T>* cached_types) {
for (typename map<StringPiece, T>::iterator it = cached_types->begin();
static void DeleteCachedTypes(std::map<StringPiece, T>* cached_types) {
for (typename std::map<StringPiece, T>::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> string_storage_;
mutable map<StringPiece, StatusOrType> cached_types_;
mutable map<StringPiece, StatusOrEnum> cached_enums_;
mutable std::map<StringPiece, StatusOrType> cached_types_;
mutable std::map<StringPiece, StatusOrEnum> cached_enums_;
mutable set<const google::protobuf::Type*> indexed_types_;
mutable map<StringPiece, StringPiece> camel_case_name_table_;
mutable std::map<StringPiece, StringPiece> camel_case_name_table_;
};
} // namespace

View File

@ -1284,7 +1284,7 @@ class MaximumMatcher {
int count1_;
int count2_;
google::protobuf::scoped_ptr<NodeMatchCallback> match_callback_;
map<pair<int, int>, bool> cached_match_results_;
std::map<pair<int, int>, bool> cached_match_results_;
vector<int>* match_list1_;
vector<int>* 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<int, int> p(left, right);
map<pair<int, int>, bool>::iterator it = cached_match_results_.find(p);
std::map<pair<int, int>, bool>::iterator it = cached_match_results_.find(p);
if (it != cached_match_results_.end()) {
return it->second;
}