|
|
|
@ -53,14 +53,15 @@ void WriteExtensionIdentifierHeader(const protobuf::FieldDescriptor* ext, |
|
|
|
|
std::string mini_table_name = |
|
|
|
|
absl::StrCat(ExtensionIdentifierBase(ext), "_", ext->name(), "_ext"); |
|
|
|
|
if (ext->extension_scope()) { |
|
|
|
|
output(R"cc( |
|
|
|
|
static ::protos::internal::ExtensionIdentifier<$0, $1> $2; |
|
|
|
|
)cc", |
|
|
|
|
ContainingTypeName(ext), CppTypeParameterName(ext), ext->name()); |
|
|
|
|
output( |
|
|
|
|
R"cc( |
|
|
|
|
static const ::protos::internal::ExtensionIdentifier<$0, $1> $2; |
|
|
|
|
)cc", |
|
|
|
|
ContainingTypeName(ext), CppTypeParameterName(ext), ext->name()); |
|
|
|
|
} else { |
|
|
|
|
output( |
|
|
|
|
R"cc( |
|
|
|
|
extern ::protos::internal::ExtensionIdentifier<$0, $1> $2; |
|
|
|
|
extern const ::protos::internal::ExtensionIdentifier<$0, $1> $2; |
|
|
|
|
)cc", |
|
|
|
|
ContainingTypeName(ext), CppTypeParameterName(ext), ext->name()); |
|
|
|
|
} |
|
|
|
@ -83,14 +84,14 @@ void WriteExtensionIdentifier(const protobuf::FieldDescriptor* ext, |
|
|
|
|
if (ext->extension_scope()) { |
|
|
|
|
output( |
|
|
|
|
R"cc( |
|
|
|
|
::protos::internal::ExtensionIdentifier<$0, $3> $4::$2(&$1); |
|
|
|
|
constexpr ::protos::internal::ExtensionIdentifier<$0, $3> $4::$2(&$1); |
|
|
|
|
)cc", |
|
|
|
|
ContainingTypeName(ext), mini_table_name, ext->name(), |
|
|
|
|
CppTypeParameterName(ext), ClassName(ext->extension_scope())); |
|
|
|
|
} else { |
|
|
|
|
output( |
|
|
|
|
R"cc( |
|
|
|
|
::protos::internal::ExtensionIdentifier<$0, $3> $2(&$1); |
|
|
|
|
constexpr ::protos::internal::ExtensionIdentifier<$0, $3> $2(&$1); |
|
|
|
|
)cc", |
|
|
|
|
ContainingTypeName(ext), mini_table_name, ext->name(), |
|
|
|
|
CppTypeParameterName(ext)); |
|
|
|
|