diff options
author | Paul Yang <TeBoring@users.noreply.github.com> | 2015-07-29 15:20:47 -0700 |
---|---|---|
committer | Paul Yang <TeBoring@users.noreply.github.com> | 2015-07-29 15:20:47 -0700 |
commit | c6dffbcb4f77d7873847a5e853e79f0ddfc3ef2a (patch) | |
tree | 3980cec23f973f60ede5841e64b7a45a1871b3b4 /src | |
parent | add3e8df57ce6330ac79fe35e59cc3717db88711 (diff) | |
parent | 5da3fb06669fd9897caf7f6002b5d72efa059dcc (diff) |
Merge pull request #652 from TeBoring/objectivec
Move the definition of GOOGLE_FALLTHROUGH_INTENDED to port.h
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/map_entry_lite.h | 12 | ||||
-rw-r--r-- | src/google/protobuf/stubs/port.h | 13 |
2 files changed, 12 insertions, 13 deletions
diff --git a/src/google/protobuf/map_entry_lite.h b/src/google/protobuf/map_entry_lite.h index 8de11766..52746da5 100644 --- a/src/google/protobuf/map_entry_lite.h +++ b/src/google/protobuf/map_entry_lite.h @@ -162,19 +162,7 @@ class MapEntryLite : public MessageLite { if (!KeyWireHandler::Read(input, mutable_key())) return false; set_has_key(); if (!input->ExpectTag(kValueTag)) break; - // BEGIN GOOGLE LOCAL MODIFICATION - // Add __has_cpp_attribute and NaCl and Emscripten checks. -#if defined(__clang__) && defined(__has_cpp_attribute) \ - && !defined(GOOGLE_PROTOBUF_OS_APPLE) -#if defined(GOOGLE_PROTOBUF_OS_NACL) || defined(EMSCRIPTEN) - [[clang::fallthrough]]; -#elif __has_cpp_attribute(clang::fallthrough) - [[clang::fallthrough]]; -#endif -#else GOOGLE_FALLTHROUGH_INTENDED; -#endif - // END GOOGLE LOCAL MODIFICATION case kValueTag: if (!ValueWireHandler::Read(input, mutable_value())) return false; 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. |