From 919fea438a5ac5366684cfa26d2bb3d17519cb60 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Mon, 18 May 2015 10:55:20 -0700 Subject: Ported upb to C89, for greater portability. A large part of this change contains surface-level porting, like moving variable declarations to the top of the block. However there are a few more substantial things too: - moved internal-only struct definitions to a separate file (structdefs.int.h), for greater encapsulation and ABI compatibility. - removed the UPB_UPCAST macro, since it requires access to the internal-only struct definitions. Replaced uses with calls to inline, type-safe casting functions. - removed the UPB_DEFINE_CLASS/UPB_DEFINE_STRUCT macros. Class and struct definitions are now more explicit -- you get to see the actual class/struct keywords in the source. The casting convenience functions have been moved into UPB_DECLARE_DERIVED_TYPE() and UPB_DECLARE_DERIVED_TYPE2(). - the new way that we duplicate base methods in derived types is also more convenient and requires less duplication. It is also less greppable, but hopefully that is not too big a problem. Compiler flags (-std=c89 -pedantic) should help to rigorously enforce that the code is free of C99-isms. A few functions are not available in C89 (strtoll). There are temporary, hacky solutions in place. --- upb/descriptor/descriptor.upb.h | 218 ++++++++++++++++++++-------------------- 1 file changed, 108 insertions(+), 110 deletions(-) (limited to 'upb/descriptor/descriptor.upb.h') diff --git a/upb/descriptor/descriptor.upb.h b/upb/descriptor/descriptor.upb.h index 3877afe..0397290 100755 --- a/upb/descriptor/descriptor.upb.h +++ b/upb/descriptor/descriptor.upb.h @@ -1,12 +1,12 @@ -// This file contains accessors for a set of compiled-in defs. -// Note that unlike Google's protobuf, it does *not* define -// generated classes or any other kind of data structure for -// actually storing protobufs. It only contains *defs* which -// let you reflect over a protobuf *schema*. -// -// This file was generated by upbc (the upb compiler). -// Do not edit -- your changes will be discarded when the file is -// regenerated. +/* This file contains accessors for a set of compiled-in defs. + * Note that unlike Google's protobuf, it does *not* define + * generated classes or any other kind of data structure for + * actually storing protobufs. It only contains *defs* which + * let you reflect over a protobuf *schema*. + */ +/* This file was generated by upbc (the upb compiler). + * Do not edit -- your changes will be discarded when the file is + * regenerated. */ #ifndef GOOGLE_PROTOBUF_DESCRIPTOR_UPB_H_ #define GOOGLE_PROTOBUF_DESCRIPTOR_UPB_H_ @@ -15,15 +15,15 @@ #include "upb/symtab.h" #ifdef __cplusplus -extern "C" { +UPB_BEGIN_EXTERN_C #endif -// Enums +/* Enums */ typedef enum { GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_LABEL_OPTIONAL = 1, GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_LABEL_REQUIRED = 2, - GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_LABEL_REPEATED = 3, + GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_LABEL_REPEATED = 3 } google_protobuf_FieldDescriptorProto_Label; typedef enum { @@ -44,24 +44,24 @@ typedef enum { GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_SFIXED32 = 15, GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_SFIXED64 = 16, GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_SINT32 = 17, - GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_SINT64 = 18, + GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_SINT64 = 18 } google_protobuf_FieldDescriptorProto_Type; typedef enum { GOOGLE_PROTOBUF_FIELDOPTIONS_STRING = 0, GOOGLE_PROTOBUF_FIELDOPTIONS_CORD = 1, - GOOGLE_PROTOBUF_FIELDOPTIONS_STRING_PIECE = 2, + GOOGLE_PROTOBUF_FIELDOPTIONS_STRING_PIECE = 2 } google_protobuf_FieldOptions_CType; typedef enum { GOOGLE_PROTOBUF_FILEOPTIONS_SPEED = 1, GOOGLE_PROTOBUF_FILEOPTIONS_CODE_SIZE = 2, - GOOGLE_PROTOBUF_FILEOPTIONS_LITE_RUNTIME = 3, + GOOGLE_PROTOBUF_FILEOPTIONS_LITE_RUNTIME = 3 } google_protobuf_FileOptions_OptimizeMode; -// Selectors +/* Selectors */ -// google.protobuf.DescriptorProto +/* google.protobuf.DescriptorProto */ #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_FIELD_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_NESTED_TYPE_STARTSUBMSG 3 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_ENUM_TYPE_STARTSUBMSG 4 @@ -88,11 +88,11 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_NAME_STARTSTR 25 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_NAME_ENDSTR 26 -// google.protobuf.DescriptorProto.ExtensionRange +/* google.protobuf.DescriptorProto.ExtensionRange */ #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSIONRANGE_START_INT32 2 #define SEL_GOOGLE_PROTOBUF_DESCRIPTORPROTO_EXTENSIONRANGE_END_INT32 3 -// google.protobuf.EnumDescriptorProto +/* google.protobuf.EnumDescriptorProto */ #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_VALUE_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_OPTIONS_STARTSUBMSG 3 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_VALUE_STARTSEQ 4 @@ -103,14 +103,14 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_NAME_STARTSTR 9 #define SEL_GOOGLE_PROTOBUF_ENUMDESCRIPTORPROTO_NAME_ENDSTR 10 -// google.protobuf.EnumOptions +/* google.protobuf.EnumOptions */ #define SEL_GOOGLE_PROTOBUF_ENUMOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_ENUMOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 #define SEL_GOOGLE_PROTOBUF_ENUMOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 #define SEL_GOOGLE_PROTOBUF_ENUMOPTIONS_UNINTERPRETED_OPTION_ENDSUBMSG 5 #define SEL_GOOGLE_PROTOBUF_ENUMOPTIONS_ALLOW_ALIAS_BOOL 6 -// google.protobuf.EnumValueDescriptorProto +/* google.protobuf.EnumValueDescriptorProto */ #define SEL_GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_OPTIONS_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_OPTIONS_ENDSUBMSG 3 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_NAME_STRING 4 @@ -118,13 +118,13 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_NAME_ENDSTR 6 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEDESCRIPTORPROTO_NUMBER_INT32 7 -// google.protobuf.EnumValueOptions +/* google.protobuf.EnumValueOptions */ #define SEL_GOOGLE_PROTOBUF_ENUMVALUEOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 #define SEL_GOOGLE_PROTOBUF_ENUMVALUEOPTIONS_UNINTERPRETED_OPTION_ENDSUBMSG 5 -// google.protobuf.FieldDescriptorProto +/* google.protobuf.FieldDescriptorProto */ #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_OPTIONS_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_OPTIONS_ENDSUBMSG 3 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_NAME_STRING 4 @@ -143,7 +143,7 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_DEFAULT_VALUE_STARTSTR 17 #define SEL_GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_DEFAULT_VALUE_ENDSTR 18 -// google.protobuf.FieldOptions +/* google.protobuf.FieldOptions */ #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 @@ -157,7 +157,7 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_EXPERIMENTAL_MAP_KEY_ENDSTR 12 #define SEL_GOOGLE_PROTOBUF_FIELDOPTIONS_WEAK_BOOL 13 -// google.protobuf.FileDescriptorProto +/* google.protobuf.FileDescriptorProto */ #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_MESSAGE_TYPE_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_ENUM_TYPE_STARTSUBMSG 3 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_SERVICE_STARTSUBMSG 4 @@ -196,13 +196,13 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_WEAK_DEPENDENCY_ENDSEQ 37 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORPROTO_WEAK_DEPENDENCY_INT32 38 -// google.protobuf.FileDescriptorSet +/* google.protobuf.FileDescriptorSet */ #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORSET_FILE_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORSET_FILE_STARTSEQ 3 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORSET_FILE_ENDSEQ 4 #define SEL_GOOGLE_PROTOBUF_FILEDESCRIPTORSET_FILE_ENDSUBMSG 5 -// google.protobuf.FileOptions +/* google.protobuf.FileOptions */ #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 @@ -223,7 +223,7 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_PY_GENERIC_SERVICES_BOOL 19 #define SEL_GOOGLE_PROTOBUF_FILEOPTIONS_JAVA_GENERATE_EQUALS_AND_HASH_BOOL 20 -// google.protobuf.MessageOptions +/* google.protobuf.MessageOptions */ #define SEL_GOOGLE_PROTOBUF_MESSAGEOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_MESSAGEOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 #define SEL_GOOGLE_PROTOBUF_MESSAGEOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 @@ -231,7 +231,7 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_MESSAGEOPTIONS_MESSAGE_SET_WIRE_FORMAT_BOOL 6 #define SEL_GOOGLE_PROTOBUF_MESSAGEOPTIONS_NO_STANDARD_DESCRIPTOR_ACCESSOR_BOOL 7 -// google.protobuf.MethodDescriptorProto +/* google.protobuf.MethodDescriptorProto */ #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OPTIONS_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OPTIONS_ENDSUBMSG 3 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_NAME_STRING 4 @@ -244,13 +244,13 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OUTPUT_TYPE_STARTSTR 11 #define SEL_GOOGLE_PROTOBUF_METHODDESCRIPTORPROTO_OUTPUT_TYPE_ENDSTR 12 -// google.protobuf.MethodOptions +/* google.protobuf.MethodOptions */ #define SEL_GOOGLE_PROTOBUF_METHODOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_METHODOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 #define SEL_GOOGLE_PROTOBUF_METHODOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 #define SEL_GOOGLE_PROTOBUF_METHODOPTIONS_UNINTERPRETED_OPTION_ENDSUBMSG 5 -// google.protobuf.ServiceDescriptorProto +/* google.protobuf.ServiceDescriptorProto */ #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_METHOD_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_OPTIONS_STARTSUBMSG 3 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_METHOD_STARTSEQ 4 @@ -261,19 +261,19 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_NAME_STARTSTR 9 #define SEL_GOOGLE_PROTOBUF_SERVICEDESCRIPTORPROTO_NAME_ENDSTR 10 -// google.protobuf.ServiceOptions +/* google.protobuf.ServiceOptions */ #define SEL_GOOGLE_PROTOBUF_SERVICEOPTIONS_UNINTERPRETED_OPTION_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_SERVICEOPTIONS_UNINTERPRETED_OPTION_STARTSEQ 3 #define SEL_GOOGLE_PROTOBUF_SERVICEOPTIONS_UNINTERPRETED_OPTION_ENDSEQ 4 #define SEL_GOOGLE_PROTOBUF_SERVICEOPTIONS_UNINTERPRETED_OPTION_ENDSUBMSG 5 -// google.protobuf.SourceCodeInfo +/* google.protobuf.SourceCodeInfo */ #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_STARTSEQ 3 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_ENDSEQ 4 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_ENDSUBMSG 5 -// google.protobuf.SourceCodeInfo.Location +/* google.protobuf.SourceCodeInfo.Location */ #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_PATH_STARTSEQ 2 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_PATH_ENDSEQ 3 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_PATH_INT32 4 @@ -287,7 +287,7 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_TRAILING_COMMENTS_STARTSTR 12 #define SEL_GOOGLE_PROTOBUF_SOURCECODEINFO_LOCATION_TRAILING_COMMENTS_ENDSTR 13 -// google.protobuf.UninterpretedOption +/* google.protobuf.UninterpretedOption */ #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAME_STARTSUBMSG 2 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAME_STARTSEQ 3 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAME_ENDSEQ 4 @@ -305,7 +305,7 @@ typedef enum { #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_AGGREGATE_VALUE_STARTSTR 16 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_AGGREGATE_VALUE_ENDSTR 17 -// google.protobuf.UninterpretedOption.NamePart +/* google.protobuf.UninterpretedOption.NamePart */ #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAMEPART_NAME_PART_STRING 2 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAMEPART_NAME_PART_STARTSTR 3 #define SEL_GOOGLE_PROTOBUF_UNINTERPRETEDOPTION_NAMEPART_NAME_PART_ENDSTR 4 @@ -313,7 +313,7 @@ typedef enum { const upb_symtab *upbdefs_google_protobuf_descriptor(const void *owner); -// MessageDefs +/* MessageDefs */ UPB_INLINE const upb_msgdef *upbdefs_google_protobuf_DescriptorProto(const upb_symtab *s) { const upb_msgdef *m = upb_symtab_lookupmsg(s, "google.protobuf.DescriptorProto"); assert(m); @@ -416,7 +416,7 @@ UPB_INLINE const upb_msgdef *upbdefs_google_protobuf_UninterpretedOption_NamePar } -// EnumDefs +/* EnumDefs */ UPB_INLINE const upb_enumdef *upbdefs_google_protobuf_FieldDescriptorProto_Label(const upb_symtab *s) { const upb_enumdef *e = upb_symtab_lookupenum(s, "google.protobuf.FieldDescriptorProto.Label"); assert(e); @@ -520,9 +520,7 @@ UPB_INLINE const upb_fielddef *upbdefs_google_protobuf_UninterpretedOption_negat UPB_INLINE const upb_fielddef *upbdefs_google_protobuf_UninterpretedOption_positive_int_value(const upb_symtab *s) { return upb_msgdef_itof(upbdefs_google_protobuf_UninterpretedOption(s), 4); } UPB_INLINE const upb_fielddef *upbdefs_google_protobuf_UninterpretedOption_string_value(const upb_symtab *s) { return upb_msgdef_itof(upbdefs_google_protobuf_UninterpretedOption(s), 7); } -#ifdef __cplusplus -}; // extern "C" -#endif +UPB_END_EXTERN_C #ifdef __cplusplus @@ -534,9 +532,9 @@ inline upb::reffed_ptr SymbolTable() { const upb::SymbolTable* s = upbdefs_google_protobuf_descriptor(&s); return upb::reffed_ptr(s, &s); } -} // namespace descriptor -} // namespace protobuf -} // namespace google +} /* namespace descriptor */ +} /* namespace protobuf */ +} /* namespace google */ #define RETURN_REFFED(type, func) \ const type* obj = func(upbdefs::google::protobuf::descriptor::SymbolTable().get()); \ @@ -553,9 +551,9 @@ inline upb::reffed_ptr field() { RETURN_REFFED(upb::FieldDe inline upb::reffed_ptr name() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_DescriptorProto_name) } inline upb::reffed_ptr nested_type() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_DescriptorProto_nested_type) } inline upb::reffed_ptr options() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_DescriptorProto_options) } -} // namespace DescriptorProto -} // namespace protobuf -} // namespace google +} /* namespace DescriptorProto */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -564,10 +562,10 @@ namespace ExtensionRange { inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb::MessageDef, upbdefs_google_protobuf_DescriptorProto_ExtensionRange) } inline upb::reffed_ptr end() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_DescriptorProto_ExtensionRange_end) } inline upb::reffed_ptr start() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_DescriptorProto_ExtensionRange_start) } -} // namespace ExtensionRange -} // namespace DescriptorProto -} // namespace protobuf -} // namespace google +} /* namespace ExtensionRange */ +} /* namespace DescriptorProto */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -576,9 +574,9 @@ inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb:: inline upb::reffed_ptr name() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_EnumDescriptorProto_name) } inline upb::reffed_ptr options() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_EnumDescriptorProto_options) } inline upb::reffed_ptr value() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_EnumDescriptorProto_value) } -} // namespace EnumDescriptorProto -} // namespace protobuf -} // namespace google +} /* namespace EnumDescriptorProto */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -586,9 +584,9 @@ namespace EnumOptions { inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb::MessageDef, upbdefs_google_protobuf_EnumOptions) } inline upb::reffed_ptr allow_alias() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_EnumOptions_allow_alias) } inline upb::reffed_ptr uninterpreted_option() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_EnumOptions_uninterpreted_option) } -} // namespace EnumOptions -} // namespace protobuf -} // namespace google +} /* namespace EnumOptions */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -597,18 +595,18 @@ inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb:: inline upb::reffed_ptr name() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_EnumValueDescriptorProto_name) } inline upb::reffed_ptr number() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_EnumValueDescriptorProto_number) } inline upb::reffed_ptr options() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_EnumValueDescriptorProto_options) } -} // namespace EnumValueDescriptorProto -} // namespace protobuf -} // namespace google +} /* namespace EnumValueDescriptorProto */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { namespace EnumValueOptions { inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb::MessageDef, upbdefs_google_protobuf_EnumValueOptions) } inline upb::reffed_ptr uninterpreted_option() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_EnumValueOptions_uninterpreted_option) } -} // namespace EnumValueOptions -} // namespace protobuf -} // namespace google +} /* namespace EnumValueOptions */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -624,9 +622,9 @@ inline upb::reffed_ptr type() { RETURN_REFFED(upb::FieldDef inline upb::reffed_ptr type_name() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_FieldDescriptorProto_type_name) } inline upb::reffed_ptr Label() { RETURN_REFFED(upb::EnumDef, upbdefs_google_protobuf_FieldDescriptorProto_Label) } inline upb::reffed_ptr Type() { RETURN_REFFED(upb::EnumDef, upbdefs_google_protobuf_FieldDescriptorProto_Type) } -} // namespace FieldDescriptorProto -} // namespace protobuf -} // namespace google +} /* namespace FieldDescriptorProto */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -640,9 +638,9 @@ inline upb::reffed_ptr packed() { RETURN_REFFED(upb::FieldD inline upb::reffed_ptr uninterpreted_option() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_FieldOptions_uninterpreted_option) } inline upb::reffed_ptr weak() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_FieldOptions_weak) } inline upb::reffed_ptr CType() { RETURN_REFFED(upb::EnumDef, upbdefs_google_protobuf_FieldOptions_CType) } -} // namespace FieldOptions -} // namespace protobuf -} // namespace google +} /* namespace FieldOptions */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -659,18 +657,18 @@ inline upb::reffed_ptr public_dependency() { RETURN_REFFED( inline upb::reffed_ptr service() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_FileDescriptorProto_service) } inline upb::reffed_ptr source_code_info() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_FileDescriptorProto_source_code_info) } inline upb::reffed_ptr weak_dependency() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_FileDescriptorProto_weak_dependency) } -} // namespace FileDescriptorProto -} // namespace protobuf -} // namespace google +} /* namespace FileDescriptorProto */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { namespace FileDescriptorSet { inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb::MessageDef, upbdefs_google_protobuf_FileDescriptorSet) } inline upb::reffed_ptr file() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_FileDescriptorSet_file) } -} // namespace FileDescriptorSet -} // namespace protobuf -} // namespace google +} /* namespace FileDescriptorSet */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -687,9 +685,9 @@ inline upb::reffed_ptr optimize_for() { RETURN_REFFED(upb:: inline upb::reffed_ptr py_generic_services() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_FileOptions_py_generic_services) } inline upb::reffed_ptr uninterpreted_option() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_FileOptions_uninterpreted_option) } inline upb::reffed_ptr OptimizeMode() { RETURN_REFFED(upb::EnumDef, upbdefs_google_protobuf_FileOptions_OptimizeMode) } -} // namespace FileOptions -} // namespace protobuf -} // namespace google +} /* namespace FileOptions */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -698,9 +696,9 @@ inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb:: inline upb::reffed_ptr message_set_wire_format() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_MessageOptions_message_set_wire_format) } inline upb::reffed_ptr no_standard_descriptor_accessor() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_MessageOptions_no_standard_descriptor_accessor) } inline upb::reffed_ptr uninterpreted_option() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_MessageOptions_uninterpreted_option) } -} // namespace MessageOptions -} // namespace protobuf -} // namespace google +} /* namespace MessageOptions */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -710,18 +708,18 @@ inline upb::reffed_ptr input_type() { RETURN_REFFED(upb::Fi inline upb::reffed_ptr name() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_MethodDescriptorProto_name) } inline upb::reffed_ptr options() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_MethodDescriptorProto_options) } inline upb::reffed_ptr output_type() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_MethodDescriptorProto_output_type) } -} // namespace MethodDescriptorProto -} // namespace protobuf -} // namespace google +} /* namespace MethodDescriptorProto */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { namespace MethodOptions { inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb::MessageDef, upbdefs_google_protobuf_MethodOptions) } inline upb::reffed_ptr uninterpreted_option() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_MethodOptions_uninterpreted_option) } -} // namespace MethodOptions -} // namespace protobuf -} // namespace google +} /* namespace MethodOptions */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -730,27 +728,27 @@ inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb:: inline upb::reffed_ptr method() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_ServiceDescriptorProto_method) } inline upb::reffed_ptr name() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_ServiceDescriptorProto_name) } inline upb::reffed_ptr options() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_ServiceDescriptorProto_options) } -} // namespace ServiceDescriptorProto -} // namespace protobuf -} // namespace google +} /* namespace ServiceDescriptorProto */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { namespace ServiceOptions { inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb::MessageDef, upbdefs_google_protobuf_ServiceOptions) } inline upb::reffed_ptr uninterpreted_option() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_ServiceOptions_uninterpreted_option) } -} // namespace ServiceOptions -} // namespace protobuf -} // namespace google +} /* namespace ServiceOptions */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { namespace SourceCodeInfo { inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb::MessageDef, upbdefs_google_protobuf_SourceCodeInfo) } inline upb::reffed_ptr location() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_SourceCodeInfo_location) } -} // namespace SourceCodeInfo -} // namespace protobuf -} // namespace google +} /* namespace SourceCodeInfo */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -761,10 +759,10 @@ inline upb::reffed_ptr leading_comments() { RETURN_REFFED(u inline upb::reffed_ptr path() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_SourceCodeInfo_Location_path) } inline upb::reffed_ptr span() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_SourceCodeInfo_Location_span) } inline upb::reffed_ptr trailing_comments() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_SourceCodeInfo_Location_trailing_comments) } -} // namespace Location -} // namespace SourceCodeInfo -} // namespace protobuf -} // namespace google +} /* namespace Location */ +} /* namespace SourceCodeInfo */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -777,9 +775,9 @@ inline upb::reffed_ptr name() { RETURN_REFFED(upb::FieldDef inline upb::reffed_ptr negative_int_value() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_UninterpretedOption_negative_int_value) } inline upb::reffed_ptr positive_int_value() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_UninterpretedOption_positive_int_value) } inline upb::reffed_ptr string_value() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_UninterpretedOption_string_value) } -} // namespace UninterpretedOption -} // namespace protobuf -} // namespace google +} /* namespace UninterpretedOption */ +} /* namespace protobuf */ +} /* namespace google */ namespace google { namespace protobuf { @@ -788,15 +786,15 @@ namespace NamePart { inline upb::reffed_ptr MessageDef() { RETURN_REFFED(upb::MessageDef, upbdefs_google_protobuf_UninterpretedOption_NamePart) } inline upb::reffed_ptr is_extension() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_UninterpretedOption_NamePart_is_extension) } inline upb::reffed_ptr name_part() { RETURN_REFFED(upb::FieldDef, upbdefs_google_protobuf_UninterpretedOption_NamePart_name_part) } -} // namespace NamePart -} // namespace UninterpretedOption -} // namespace protobuf -} // namespace google +} /* namespace NamePart */ +} /* namespace UninterpretedOption */ +} /* namespace protobuf */ +} /* namespace google */ -} // namespace upbdefs +} /* namespace upbdefs */ #undef RETURN_REFFED -#endif // __cplusplus +#endif /* __cplusplus */ -#endif // GOOGLE_PROTOBUF_DESCRIPTOR_UPB_H_ +#endif /* GOOGLE_PROTOBUF_DESCRIPTOR_UPB_H_ */ -- cgit v1.2.3