瀏覽代碼

Merge pull request #4936 from arashikou/3.5.x

Do Not Define GOOGLE_FALLTHROUGH_INTENDED on GCC Without Attribute Support
Feng Xiao 7 年之前
父節點
當前提交
71985bed4f
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/google/protobuf/stubs/port.h

+ 1 - 1
src/google/protobuf/stubs/port.h

@@ -243,7 +243,7 @@ static const uint64 kuint64max = GOOGLE_ULONGLONG(0xFFFFFFFFFFFFFFFF);
      __has_cpp_attribute(clang::fallthrough)
 #  define GOOGLE_FALLTHROUGH_INTENDED [[clang::fallthrough]]
 # endif
-#elif defined(__GNUC__) && __GNUC__ > 6
+#elif defined(__GNUC__) && __GNUC__ > 6 && __cpp_attributes >= 200809
 # define GOOGLE_FALLTHROUGH_INTENDED [[gnu::fallthrough]]
 #endif