aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/stubs/port.h
diff options
context:
space:
mode:
authorteboring <paulyang1211@gmail.com>2015-07-29 10:44:19 -0700
committerteboring <paulyang1211@gmail.com>2015-07-29 14:34:52 -0700
commit5da3fb06669fd9897caf7f6002b5d72efa059dcc (patch)
tree10983aff88a0e6afa85952019a23956aeabaef50 /src/google/protobuf/stubs/port.h
parentf642c5cfddbe54dcab5416178880c4e27c8ed4cd (diff)
downloadprotobuf-5da3fb06669fd9897caf7f6002b5d72efa059dcc.tar.gz
protobuf-5da3fb06669fd9897caf7f6002b5d72efa059dcc.tar.bz2
protobuf-5da3fb06669fd9897caf7f6002b5d72efa059dcc.zip
Move the definition of GOOGLE_FALLTHROUGH_INTENDED to port.h
Diffstat (limited to 'src/google/protobuf/stubs/port.h')
-rw-r--r--src/google/protobuf/stubs/port.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h
index c86cf35b..8a5d1a13 100644
--- a/src/google/protobuf/stubs/port.h
+++ b/src/google/protobuf/stubs/port.h
@@ -204,8 +204,19 @@ static const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF);
#define GOOGLE_SAFE_CONCURRENT_WRITES_END()
#endif
+#if defined(__clang__) && defined(__has_cpp_attribute) \
+ && !defined(GOOGLE_PROTOBUF_OS_APPLE)
+# if defined(GOOGLE_PROTOBUF_OS_NACL) || defined(EMSCRIPTEN) || \
+ __has_cpp_attribute(clang::fallthrough)
+# define GOOGLE_FALLTHROUGH_INTENDED [[clang::fallthrough]]
+# endif
+#endif
+
+#ifndef GOOGLE_FALLTHROUGH_INTENDED
+# define GOOGLE_FALLTHROUGH_INTENDED
+#endif
+
#define GOOGLE_GUARDED_BY(x)
-#define GOOGLE_FALLTHROUGH_INTENDED
#define GOOGLE_ATTRIBUTE_COLD
// x86 and x86-64 can perform unaligned loads/stores directly.