diff --git a/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs b/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs new file mode 100644 index 0000000000..208ce1fcb6 --- /dev/null +++ b/csharp/src/Google.Protobuf/Reflection/FeatureSetDescriptor.g.cs @@ -0,0 +1,17 @@ +#region Copyright notice and license +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd +#endregion + +namespace Google.Protobuf.Reflection; + +internal sealed partial class FeatureSetDescriptor +{ + // Canonical serialized form of the edition defaults, generated by embed_edition_defaults. + private const string DefaultsBase64 = + "ChMYhAciACoMCAEQAhgCIAMoATACChMY5wciACoMCAIQARgBIAIoATABChMY6AciDAgBEAEYASACKAEwASoAIOYHKOgH"; +} diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c index 502bf57bd0..468f287a22 100644 --- a/php/ext/google/protobuf/php-upb.c +++ b/php/ext/google/protobuf/php-upb.c @@ -3603,13 +3603,19 @@ void upb_Array_Freeze(upb_Array* arr, const upb_MiniTable* m) { // Must be last. -const upb_MiniTableExtension* upb_Message_ExtensionByIndex( - const upb_Message* msg, size_t index) { +bool upb_Message_NextExtension(const upb_Message* msg, + const upb_MiniTableExtension** result, + uintptr_t* iter) { size_t count; const upb_Extension* ext = UPB_PRIVATE(_upb_Message_Getexts)(msg, &count); - - UPB_ASSERT(index < count); - return ext[index].ext; + size_t i = *iter; + if (i >= count) { + return false; + *result = NULL; + } + *result = ext[i].ext; + *iter = i + 1; + return true; } const upb_MiniTableExtension* upb_Message_FindExtensionByNumber( diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h index 2aca71f940..e87af89fe9 100644 --- a/php/ext/google/protobuf/php-upb.h +++ b/php/ext/google/protobuf/php-upb.h @@ -13571,9 +13571,11 @@ UPB_INLINE bool _upb_NonAtomic_CompareExchangeStrongP(void* addr, extern "C" { #endif -const upb_MiniTableExtension* upb_Message_ExtensionByIndex( - const upb_Message* msg, size_t index); +#define kUpb_Message_ExtensionBegin 0; +bool upb_Message_NextExtension(const upb_Message* msg, + const upb_MiniTableExtension** result, + uintptr_t* iter); // Returns the minitable with the given field number, or NULL on failure. const upb_MiniTableExtension* upb_Message_FindExtensionByNumber( const upb_Message* msg, uint32_t field_number); diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c index 6039bcd55f..e7abb2159f 100644 --- a/ruby/ext/google/protobuf_c/ruby-upb.c +++ b/ruby/ext/google/protobuf_c/ruby-upb.c @@ -3603,13 +3603,19 @@ void upb_Array_Freeze(upb_Array* arr, const upb_MiniTable* m) { // Must be last. -const upb_MiniTableExtension* upb_Message_ExtensionByIndex( - const upb_Message* msg, size_t index) { +bool upb_Message_NextExtension(const upb_Message* msg, + const upb_MiniTableExtension** result, + uintptr_t* iter) { size_t count; const upb_Extension* ext = UPB_PRIVATE(_upb_Message_Getexts)(msg, &count); - - UPB_ASSERT(index < count); - return ext[index].ext; + size_t i = *iter; + if (i >= count) { + return false; + *result = NULL; + } + *result = ext[i].ext; + *iter = i + 1; + return true; } const upb_MiniTableExtension* upb_Message_FindExtensionByNumber( diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h index f564c75dcb..2d8853d797 100755 --- a/ruby/ext/google/protobuf_c/ruby-upb.h +++ b/ruby/ext/google/protobuf_c/ruby-upb.h @@ -13573,9 +13573,11 @@ UPB_INLINE bool _upb_NonAtomic_CompareExchangeStrongP(void* addr, extern "C" { #endif -const upb_MiniTableExtension* upb_Message_ExtensionByIndex( - const upb_Message* msg, size_t index); +#define kUpb_Message_ExtensionBegin 0; +bool upb_Message_NextExtension(const upb_Message* msg, + const upb_MiniTableExtension** result, + uintptr_t* iter); // Returns the minitable with the given field number, or NULL on failure. const upb_MiniTableExtension* upb_Message_FindExtensionByNumber( const upb_Message* msg, uint32_t field_number);