aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/stubs/stringpiece.h
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2015-06-15 21:42:57 -0700
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2015-06-17 11:19:46 -0700
commit818c5eee08840355d70d2f3bdf1a2f17986a5e70 (patch)
treee6db0b1344385f8c48820c58d7297f653bff39f7 /src/google/protobuf/stubs/stringpiece.h
parente96ff30120a3834f7d1e31e43e591bf7cfbd731f (diff)
Fix broken builds.
Diffstat (limited to 'src/google/protobuf/stubs/stringpiece.h')
-rw-r--r--src/google/protobuf/stubs/stringpiece.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/google/protobuf/stubs/stringpiece.h b/src/google/protobuf/stubs/stringpiece.h
index 5d4d5fe4..353a60d3 100644
--- a/src/google/protobuf/stubs/stringpiece.h
+++ b/src/google/protobuf/stubs/stringpiece.h
@@ -174,7 +174,7 @@ typedef string::difference_type stringpiece_ssize_type;
#define STRINGPIECE_CHECK_SIZE 0
#endif
-class StringPiece {
+class LIBPROTOBUF_EXPORT StringPiece {
private:
const char* ptr_;
stringpiece_ssize_type length_;
@@ -183,6 +183,9 @@ class StringPiece {
// sizeof(stringpiece_ssize_type) may be smaller than sizeof(size_t).
static stringpiece_ssize_type CheckedSsizeTFromSizeT(size_t size) {
#if STRINGPIECE_CHECK_SIZE > 0
+#ifdef max
+#undef max
+#endif
if (size > static_cast<size_t>(
std::numeric_limits<stringpiece_ssize_type>::max())) {
// Some people grep for this message in logs