Skip to content

Commit

Permalink
Auto-generate files after cl/708100356
Browse files Browse the repository at this point in the history
  • Loading branch information
protobuf-team-bot committed Dec 20, 2024
1 parent a673dcc commit 20a6e82
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions php/ext/google/protobuf/php-upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <math.h>
#include <stddef.h>
Expand Down
4 changes: 4 additions & 0 deletions php/ext/google/protobuf/php-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions ruby/ext/google/protobuf_c/ruby-upb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <math.h>
#include <stddef.h>
Expand Down
4 changes: 4 additions & 0 deletions ruby/ext/google/protobuf_c/ruby-upb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 20a6e82

Please sign in to comment.