Add an EDITION_MAX enum value for plugins that will never need edition-based changes

PiperOrigin-RevId: 586781244
pull/14919/head
Mike Kruskal 1 year ago committed by Copybara-Service
parent 962135a727
commit f99c0bd47e
  1. 15
      src/google/protobuf/descriptor.pb.cc
  2. 4
      src/google/protobuf/descriptor.pb.h
  3. 5
      src/google/protobuf/descriptor.proto
  4. 2
      upb/reflection/stage0/google/protobuf/descriptor.upb.c
  5. 3
      upb/reflection/stage0/google/protobuf/descriptor.upb.h

@ -1891,22 +1891,23 @@ const char descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto[] AB
"\022\r\n\005begin\030\003 \001(\005\022\013\n\003end\030\004 \001(\005\022H\n\010semantic"
"\030\005 \001(\01626.google.protobuf.GeneratedCodeIn"
"fo.Annotation.Semantic\"(\n\010Semantic\022\010\n\004NO"
"NE\020\000\022\007\n\003SET\020\001\022\t\n\005ALIAS\020\002*\352\001\n\007Edition\022\023\n\017"
"NE\020\000\022\007\n\003SET\020\001\022\t\n\005ALIAS\020\002*\377\001\n\007Edition\022\023\n\017"
"EDITION_UNKNOWN\020\000\022\023\n\016EDITION_PROTO2\020\346\007\022\023"
"\n\016EDITION_PROTO3\020\347\007\022\021\n\014EDITION_2023\020\350\007\022\027"
"\n\023EDITION_1_TEST_ONLY\020\001\022\027\n\023EDITION_2_TES"
"T_ONLY\020\002\022\035\n\027EDITION_99997_TEST_ONLY\020\235\215\006\022"
"\035\n\027EDITION_99998_TEST_ONLY\020\236\215\006\022\035\n\027EDITIO"
"N_99999_TEST_ONLY\020\237\215\006B~\n\023com.google.prot"
"obufB\020DescriptorProtosH\001Z-google.golang."
"org/protobuf/types/descriptorpb\370\001\001\242\002\003GPB"
"\252\002\032Google.Protobuf.Reflection"
"N_99999_TEST_ONLY\020\237\215\006\022\023\n\013EDITION_MAX\020\377\377\377"
"\377\007B~\n\023com.google.protobufB\020DescriptorPro"
"tosH\001Z-google.golang.org/protobuf/types/"
"descriptorpb\370\001\001\242\002\003GPB\252\002\032Google.Protobuf."
"Reflection"
};
static ::absl::once_flag descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once;
const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto = {
false,
false,
9549,
9570,
descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto,
"google/protobuf/descriptor.proto",
&descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once,
@ -2345,7 +2346,7 @@ const ::google::protobuf::EnumDescriptor* Edition_descriptor() {
return file_level_enum_descriptors_google_2fprotobuf_2fdescriptor_2eproto[16];
}
PROTOBUF_CONSTINIT const uint32_t Edition_internal_data_[] = {
196608u, 393216u, 99997u, 999u, 99999u, 998u, 1000u, 99998u, };
196608u, 458752u, 99997u, 999u, 99999u, 998u, 1000u, 99998u, 2147483647u, };
bool Edition_IsValid(int value) {
return ::_pbi::ValidateEnum(value, Edition_internal_data_);
}

@ -670,13 +670,13 @@ enum Edition : int {
EDITION_99997_TEST_ONLY = 99997,
EDITION_99998_TEST_ONLY = 99998,
EDITION_99999_TEST_ONLY = 99999,
EDITION_MAX = 2147483647,
};
PROTOBUF_EXPORT bool Edition_IsValid(int value);
PROTOBUF_EXPORT extern const uint32_t Edition_internal_data_[];
constexpr Edition Edition_MIN = static_cast<Edition>(0);
constexpr Edition Edition_MAX = static_cast<Edition>(99999);
constexpr int Edition_ARRAYSIZE = 99999 + 1;
constexpr Edition Edition_MAX = static_cast<Edition>(2147483647);
PROTOBUF_EXPORT const ::google::protobuf::EnumDescriptor*
Edition_descriptor();
template <typename T>

@ -81,6 +81,11 @@ enum Edition {
EDITION_99997_TEST_ONLY = 99997;
EDITION_99998_TEST_ONLY = 99998;
EDITION_99999_TEST_ONLY = 99999;
// Placeholder for specifying unbounded edition support. This should only
// ever be used by plugins that can expect to never require any changes to
// support a new edition.
EDITION_MAX = 0x7FFFFFFF;
}
// Describes a complete .proto file.

@ -401,7 +401,7 @@ const upb_MiniTable* google__protobuf__GeneratedCodeInfo__Annotation_msg_init()
const upb_MiniTableEnum* google_protobuf_Edition_enum_init() {
static const upb_MiniTableEnum* mini_table = NULL;
static const char* mini_descriptor = "!)`~)qt_b)";
static const char* mini_descriptor = "!)`~)qt_b)|i}{~~`!";
if (mini_table) return mini_table;
mini_table =
upb_MiniTableEnum_Build(mini_descriptor, strlen(mini_descriptor),

@ -109,7 +109,8 @@ typedef enum {
google_protobuf_EDITION_2023 = 1000,
google_protobuf_EDITION_99997_TEST_ONLY = 99997,
google_protobuf_EDITION_99998_TEST_ONLY = 99998,
google_protobuf_EDITION_99999_TEST_ONLY = 99999
google_protobuf_EDITION_99999_TEST_ONLY = 99999,
google_protobuf_EDITION_MAX = 2147483647
} google_protobuf_Edition;
typedef enum {

Loading…
Cancel
Save