From 20a6e82ceb080c00278f33bf9384ee3a1668aa17 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Fri, 20 Dec 2024 01:52:29 +0000 Subject: [PATCH] Auto-generate files after cl/708100356 --- php/ext/google/protobuf/php-upb.c | 11 +++++++++++ php/ext/google/protobuf/php-upb.h | 4 ++++ ruby/ext/google/protobuf_c/ruby-upb.c | 11 +++++++++++ ruby/ext/google/protobuf_c/ruby-upb.h | 4 ++++ 4 files changed, 30 insertions(+) diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c index 1c0a0b158092..facb63d11b82 100644 --- a/php/ext/google/protobuf/php-upb.c +++ b/php/ext/google/protobuf/php-upb.c @@ -12441,6 +12441,17 @@ upb_Extension* UPB_PRIVATE(_upb_Message_GetOrCreateExtension)( return ext; } +void upb_Message_ReplaceUnknownWithExtension(struct upb_Message* msg, + uintptr_t iter, + const upb_Extension* ext) { + UPB_ASSERT(iter != 0); + upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg); + UPB_ASSERT(in); + size_t index = iter - 1; + upb_TaggedAuxPtr tagged_ptr = in->aux_data[index]; + UPB_ASSERT(upb_TaggedAuxPtr_IsUnknown(tagged_ptr)); + in->aux_data[index] = upb_TaggedAuxPtr_MakeExtension(ext); +} #include #include diff --git a/php/ext/google/protobuf/php-upb.h b/php/ext/google/protobuf/php-upb.h index 93a219363eba..def0094443a7 100644 --- a/php/ext/google/protobuf/php-upb.h +++ b/php/ext/google/protobuf/php-upb.h @@ -3010,6 +3010,10 @@ UPB_INLINE bool UPB_PRIVATE(_upb_Extension_IsEmpty)(const upb_Extension* ext) { UPB_UNREACHABLE(); } +// Replaces the unknown field at iter with the provided extension. +void upb_Message_ReplaceUnknownWithExtension(struct upb_Message* msg, + uintptr_t iter, + const upb_Extension* ext); #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c index db45c7e0a762..870216df1520 100644 --- a/ruby/ext/google/protobuf_c/ruby-upb.c +++ b/ruby/ext/google/protobuf_c/ruby-upb.c @@ -11928,6 +11928,17 @@ upb_Extension* UPB_PRIVATE(_upb_Message_GetOrCreateExtension)( return ext; } +void upb_Message_ReplaceUnknownWithExtension(struct upb_Message* msg, + uintptr_t iter, + const upb_Extension* ext) { + UPB_ASSERT(iter != 0); + upb_Message_Internal* in = UPB_PRIVATE(_upb_Message_GetInternal)(msg); + UPB_ASSERT(in); + size_t index = iter - 1; + upb_TaggedAuxPtr tagged_ptr = in->aux_data[index]; + UPB_ASSERT(upb_TaggedAuxPtr_IsUnknown(tagged_ptr)); + in->aux_data[index] = upb_TaggedAuxPtr_MakeExtension(ext); +} #include #include diff --git a/ruby/ext/google/protobuf_c/ruby-upb.h b/ruby/ext/google/protobuf_c/ruby-upb.h index 2d2b361c79b6..057409fb9ac9 100755 --- a/ruby/ext/google/protobuf_c/ruby-upb.h +++ b/ruby/ext/google/protobuf_c/ruby-upb.h @@ -3012,6 +3012,10 @@ UPB_INLINE bool UPB_PRIVATE(_upb_Extension_IsEmpty)(const upb_Extension* ext) { UPB_UNREACHABLE(); } +// Replaces the unknown field at iter with the provided extension. +void upb_Message_ReplaceUnknownWithExtension(struct upb_Message* msg, + uintptr_t iter, + const upb_Extension* ext); #ifdef __cplusplus } /* extern "C" */ #endif