diff --git a/src/google/protobuf/compiler/cpp/enum.cc b/src/google/protobuf/compiler/cpp/enum.cc index fdfcd4a6aa..552e874d46 100644 --- a/src/google/protobuf/compiler/cpp/enum.cc +++ b/src/google/protobuf/compiler/cpp/enum.cc @@ -143,7 +143,7 @@ void EnumGenerator::GenerateDefinition(io::Printer* p) { .AnnotatedAs(value), {"kNumber", Int32ToString(value->number())}, {"DEPRECATED", value->options().deprecated() - ? "PROTOBUF_DEPRECATED_ENUM" + ? "PROTOBUF_DEPRECATED" : ""}, }, R"cc( @@ -302,7 +302,7 @@ void EnumGenerator::GenerateSymbolImports(io::Printer* p) const { { Sub("VALUE", EnumValueName(enum_->value(j))).AnnotatedAs(value), {"DEPRECATED", - value->options().deprecated() ? "PROTOBUF_DEPRECATED_ENUM" : ""}, + value->options().deprecated() ? "PROTOBUF_DEPRECATED" : ""}, }, R"cc( $DEPRECATED $static constexpr $Enum_$ $VALUE$ = $Msg_Enum$_$VALUE$; diff --git a/src/google/protobuf/compiler/cpp/helpers.h b/src/google/protobuf/compiler/cpp/helpers.h index df9fba5474..5d0007fa8e 100644 --- a/src/google/protobuf/compiler/cpp/helpers.h +++ b/src/google/protobuf/compiler/cpp/helpers.h @@ -82,7 +82,7 @@ inline std::string DeprecatedAttribute(const Options& /* options */, inline std::string DeprecatedAttribute(const Options& /* options */, const EnumValueDescriptor* d) { - return d->options().deprecated() ? "PROTOBUF_DEPRECATED_ENUM " : ""; + return d->options().deprecated() ? "PROTOBUF_DEPRECATED " : ""; } // Commonly-used separator comments. Thick is a line of '=', thin is a line diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc index 3283030c16..30f0f8e6e6 100644 --- a/src/google/protobuf/port_def.inc +++ b/src/google/protobuf/port_def.inc @@ -386,16 +386,6 @@ static_assert(PROTOBUF_CPLUSPLUS_MIN(201402L), "Protobuf only supports C++14 and # define PROTOBUF_DEPRECATED_MSG(msg) #endif -#if defined(PROTOBUF_DEPRECATED_ENUM) -#error PROTOBUF_DEPRECATED_ENUM was previously defined -#endif -#if defined(__clang__) || defined(__GNUC__) -// https://gcc.gnu.org/gcc-6/changes.html -# define PROTOBUF_DEPRECATED_ENUM __attribute__((deprecated)) -#else -# define PROTOBUF_DEPRECATED_ENUM -#endif - #if defined(__clang__) #define PROTOBUF_IGNORE_DEPRECATION_START \ _Pragma("clang diagnostic push") \ diff --git a/src/google/protobuf/port_undef.inc b/src/google/protobuf/port_undef.inc index a0a5f648df..169b2c130a 100644 --- a/src/google/protobuf/port_undef.inc +++ b/src/google/protobuf/port_undef.inc @@ -56,7 +56,6 @@ #undef PROTOBUF_NOINLINE #undef PROTOBUF_SECTION_VARIABLE #undef PROTOBUF_DEPRECATED -#undef PROTOBUF_DEPRECATED_ENUM #undef PROTOBUF_DEPRECATED_MSG #undef PROTOBUF_IGNORE_DEPRECATION_START #undef PROTOBUF_IGNORE_DEPRECATION_STOP