From 83964a9ab481a245274c6a13584df5038480037d Mon Sep 17 00:00:00 2001 From: "jieluo@google.com" Date: Thu, 7 Aug 2014 19:08:05 +0000 Subject: [PATCH] 1, Add comments for include we added for min/max on VS2013. 2, Add #if/#endif to wrap #undef --- src/google/protobuf/repeated_field.h | 1 + src/google/protobuf/stubs/atomicops.h | 2 ++ src/google/protobuf/wire_format_lite_inl.h | 1 + 3 files changed, 4 insertions(+) diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index d1b2312122..00e8311090 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -47,6 +47,7 @@ #define GOOGLE_PROTOBUF_REPEATED_FIELD_H__ #ifdef _MSC_VER +// This is required for min/max on VS2013 only. #include #endif diff --git a/src/google/protobuf/stubs/atomicops.h b/src/google/protobuf/stubs/atomicops.h index c9d86c5f6c..08474904a1 100644 --- a/src/google/protobuf/stubs/atomicops.h +++ b/src/google/protobuf/stubs/atomicops.h @@ -120,7 +120,9 @@ Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, Atomic32 old_value, Atomic32 new_value); +#if defined(__MINGW32__) && defined(MemoryBarrier) #undef MemoryBarrier +#endif void MemoryBarrier(); void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value); void Acquire_Store(volatile Atomic32* ptr, Atomic32 value); diff --git a/src/google/protobuf/wire_format_lite_inl.h b/src/google/protobuf/wire_format_lite_inl.h index 2b5763ce82..ca367f5927 100644 --- a/src/google/protobuf/wire_format_lite_inl.h +++ b/src/google/protobuf/wire_format_lite_inl.h @@ -37,6 +37,7 @@ #define GOOGLE_PROTOBUF_WIRE_FORMAT_LITE_INL_H__ #ifdef _MSC_VER +// This is required for min/max on VS2013 only. #include #endif