aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/stubs/port.h
diff options
context:
space:
mode:
authorGravatar Chris Kennelly <ckennelly@google.com>2016-12-14 14:03:55 -0800
committerGravatar Chris Kennelly <ckennelly@google.com>2016-12-14 14:03:55 -0800
commita902e2588d3917c867632e120906019cfca409fa (patch)
tree81748d3fab2948bbae670ad33aa59480eb25c198 /src/google/protobuf/stubs/port.h
parent83d681ee2caef1feb009656417830f846382d8ba (diff)
Define LANG_CXX11 for port.h and use this to guard C++11 features.
Diffstat (limited to 'src/google/protobuf/stubs/port.h')
-rw-r--r--src/google/protobuf/stubs/port.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h
index d5ef166e..72adba6d 100644
--- a/src/google/protobuf/stubs/port.h
+++ b/src/google/protobuf/stubs/port.h
@@ -97,6 +97,15 @@
// ===================================================================
// from google3/base/port.h
+
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L || \
+ (defined(_MSC_VER) && _MSC_VER >= 1900))
+// Define this to 1 if the code is compiled in C++11 mode; leave it
+// undefined otherwise. Do NOT define it to 0 -- that causes
+// '#ifdef LANG_CXX11' to behave differently from '#if LANG_CXX11'.
+#define LANG_CXX11 1
+#endif
+
namespace google {
namespace protobuf {