Sfoglia il codice sorgente

Add GOOGLE_ prefix before PROTOBUF_DEPRECATED_ATTR

Bo Yang 9 anni fa
parent
commit
401e07d372

+ 1 - 1
src/google/protobuf/compiler/cpp/cpp_enum.cc

@@ -189,7 +189,7 @@ void EnumGenerator::GenerateSymbolImports(io::Printer* printer) {
   for (int j = 0; j < descriptor_->value_count(); j++) {
     vars["tag"] = EnumValueName(descriptor_->value(j));
     vars["deprecated_attr"] = descriptor_->value(j)->options().deprecated() ?
-      "PROTOBUF_DEPRECATED_ATTR " : "";
+      "GOOGLE_PROTOBUF_DEPRECATED_ATTR " : "";
     printer->Print(vars,
       "$deprecated_attr$static $constexpr$const $nested_name$ $tag$ =\n"
       "  $classname$_$tag$;\n");

+ 1 - 1
src/google/protobuf/compiler/cpp/cpp_field.cc

@@ -78,7 +78,7 @@ void SetCommonFieldVariables(const FieldDescriptor* descriptor,
   (*variables)["deprecation"] = descriptor->options().deprecated()
       ? " PROTOBUF_DEPRECATED" : "";
   (*variables)["deprecated_attr"] = descriptor->options().deprecated()
-      ? "PROTOBUF_DEPRECATED_ATTR " : "";
+      ? "GOOGLE_PROTOBUF_DEPRECATED_ATTR " : "";
 
   (*variables)["cppget"] = "Get";
 

+ 1 - 1
src/google/protobuf/generated_message_util.h

@@ -63,7 +63,7 @@ namespace internal {
 #undef DEPRECATED_PROTOBUF_FIELD
 #define PROTOBUF_DEPRECATED
 
-#define PROTOBUF_DEPRECATED_ATTR
+#define GOOGLE_PROTOBUF_DEPRECATED_ATTR
 
 
 // Constants for special floating point values.