Commit 9659ea9e authored by Feng Xiao's avatar Feng Xiao

Fix compilation errors when built internally.

  1. mathlimits.h must be included before the inclusion of cmath (which
     gtest/gtest.h seems to include).
  2. hash function for StringPiece doesn't work.

Change-Id: I358a25d941a25b10b39fe76780eda41557699811
parent 59635c13
...@@ -34,9 +34,10 @@ ...@@ -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 {
......
...@@ -602,7 +602,7 @@ void ProtoStreamObjectWriter::ProtoElement::TakeOneofIndex(int32 index) { ...@@ -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,
......
...@@ -305,7 +305,7 @@ class LIBPROTOBUF_EXPORT ProtoStreamObjectWriter : public StructuredObjectWriter ...@@ -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);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment