Просмотр исходного кода

Merge pull request #931 from xfxyjwf/fix_compile

Fix compilation errors when built internally.
Feng Xiao 10 лет назад
Родитель
Сommit
ec9f45b106

+ 2 - 1
src/google/protobuf/util/field_comparator_test.cc

@@ -34,9 +34,10 @@
 
 
 #include <google/protobuf/unittest.pb.h>
 #include <google/protobuf/unittest.pb.h>
 #include <google/protobuf/descriptor.h>
 #include <google/protobuf/descriptor.h>
-#include <gtest/gtest.h>
 #include <google/protobuf/stubs/mathutil.h>
 #include <google/protobuf/stubs/mathutil.h>
 
 
+#include <gtest/gtest.h>
+
 namespace google {
 namespace google {
 namespace protobuf {
 namespace protobuf {
 namespace util {
 namespace util {

+ 1 - 1
src/google/protobuf/util/internal/protostream_objectwriter.cc

@@ -602,7 +602,7 @@ void ProtoStreamObjectWriter::ProtoElement::TakeOneofIndex(int32 index) {
 
 
 bool ProtoStreamObjectWriter::ProtoElement::InsertMapKeyIfNotPresent(
 bool ProtoStreamObjectWriter::ProtoElement::InsertMapKeyIfNotPresent(
     StringPiece map_key) {
     StringPiece map_key) {
-  return InsertIfNotPresent(&map_keys_, map_key);
+  return InsertIfNotPresent(&map_keys_, map_key.ToString());
 }
 }
 
 
 inline void ProtoStreamObjectWriter::InvalidName(StringPiece unknown_name,
 inline void ProtoStreamObjectWriter::InvalidName(StringPiece unknown_name,

+ 1 - 1
src/google/protobuf/util/internal/protostream_objectwriter.h

@@ -305,7 +305,7 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectWriter : public StructuredObjectWriter
 
 
     // Set of map keys already seen for the type_. Used to validate incoming
     // Set of map keys already seen for the type_. Used to validate incoming
     // messages so no map key appears more than once.
     // messages so no map key appears more than once.
-    hash_set<StringPiece> map_keys_;
+    hash_set<string> map_keys_;
 
 
     GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(ProtoElement);
     GOOGLE_DISALLOW_IMPLICIT_CONSTRUCTORS(ProtoElement);
   };
   };