diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2017-03-14 23:12:52 +0000 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2017-03-14 23:41:54 +0000 |
commit | 416f90939d4de58fe1a4e2489120010313183291 (patch) | |
tree | 4c879e5f8255c7d8ffbec69954042331cf1eee09 /src/google/protobuf/stubs/stringpiece_unittest.cc | |
parent | 43f2db776c265a9b22500e7a67af583b2b4ce85f (diff) | |
download | protobuf-416f90939d4de58fe1a4e2489120010313183291.tar.gz protobuf-416f90939d4de58fe1a4e2489120010313183291.tar.bz2 protobuf-416f90939d4de58fe1a4e2489120010313183291.zip |
Fix freebsd build.
It turns out system headers included by generated plugin.pb.h file already contains
major/minor macro definitions when built on FreeBSD and we need to add #undefs to
the generated header file.
This change also fixes another compile error regarding EXPECT_DEATH on FreeBSD.
Diffstat (limited to 'src/google/protobuf/stubs/stringpiece_unittest.cc')
-rw-r--r-- | src/google/protobuf/stubs/stringpiece_unittest.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/google/protobuf/stubs/stringpiece_unittest.cc b/src/google/protobuf/stubs/stringpiece_unittest.cc index a52d81f8..a6a87595 100644 --- a/src/google/protobuf/stubs/stringpiece_unittest.cc +++ b/src/google/protobuf/stubs/stringpiece_unittest.cc @@ -783,11 +783,13 @@ TEST(FindOneCharTest, EdgeCases) { EXPECT_EQ(StringPiece::npos, a.rfind('x')); } +#ifdef PROTOBUF_HAS_DEATH_TEST #ifndef NDEBUG TEST(NonNegativeLenTest, NonNegativeLen) { EXPECT_DEATH(StringPiece("xyz", -1), "len >= 0"); } #endif // ndef DEBUG +#endif // PROTOBUF_HAS_DEATH_TEST } // namespace } // namespace protobuf |