Skip to content

Commit 2ec6030

Browse files
Update witapi-core.c for the latest wit-bindgen'ed source
1 parent c810d6c commit 2ec6030

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

ext/witapi/witapi-core.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,18 @@ void rb_abi_guest_ruby_init_loadpath(void) {
173173
RB_WASM_LIB_RT(ruby_init_loadpath())
174174
}
175175

176-
void rb_abi_guest_rb_eval_string_protect(rb_abi_guest_string_t *str,
177-
rb_abi_guest_rb_abi_value_t *result,
178-
int32_t *state) {
176+
void rb_abi_guest_rb_eval_string_protect(
177+
rb_abi_guest_string_t *str, rb_abi_guest_tuple2_rb_abi_value_s32_t *ret0) {
179178
VALUE retval;
180179
RB_WASM_DEBUG_LOG("rb_eval_string_protect: str = %s\n", str->ptr);
181-
RB_WASM_LIB_RT(retval = rb_eval_string_protect(str->ptr, state));
180+
RB_WASM_LIB_RT(retval = rb_eval_string_protect(str->ptr, &ret0->f1));
182181
RB_WASM_DEBUG_LOG("rb_eval_string_protect: retval = %p, state = %d\n",
183-
(void *)retval, *state);
182+
(void *)retval, ret0->f1);
184183

185-
if (*state == TAG_NONE) {
184+
if (ret0->f1 == TAG_NONE) {
186185
rb_abi_lend_object(retval);
187186
}
188-
*result = rb_abi_guest_rb_abi_value_new((void *)retval);
187+
ret0->f0 = rb_abi_guest_rb_abi_value_new((void *)retval);
189188
}
190189

191190
struct rb_funcallv_thunk_ctx {
@@ -203,23 +202,23 @@ VALUE rb_funcallv_thunk(VALUE arg) {
203202
return rb_funcallv(ctx->recv, ctx->mid, ctx->args->len, c_argv);
204203
}
205204

206-
void rb_abi_guest_rb_funcallv_protect(rb_abi_guest_rb_abi_value_t recv,
207-
rb_abi_guest_rb_id_t mid,
208-
rb_abi_guest_list_rb_abi_value_t *args,
209-
rb_abi_guest_rb_abi_value_t *ret0,
210-
int32_t *ret1) {
205+
void rb_abi_guest_rb_funcallv_protect(
206+
rb_abi_guest_rb_abi_value_t recv, rb_abi_guest_rb_id_t mid,
207+
rb_abi_guest_list_rb_abi_value_t *args,
208+
rb_abi_guest_tuple2_rb_abi_value_s32_t *ret0) {
211209
VALUE retval;
212210
VALUE r_recv = (VALUE)rb_abi_guest_rb_abi_value_get(&recv);
213211
struct rb_funcallv_thunk_ctx ctx = {.recv = r_recv, .mid = mid, .args = args};
214-
RB_WASM_LIB_RT(retval = rb_protect(rb_funcallv_thunk, (VALUE)&ctx, ret1));
212+
RB_WASM_LIB_RT(retval =
213+
rb_protect(rb_funcallv_thunk, (VALUE)&ctx, &ret0->f1));
215214
RB_WASM_DEBUG_LOG(
216215
"rb_abi_guest_rb_funcallv_protect: retval = %p, state = %d\n",
217-
(void *)retval, *ret1);
216+
(void *)retval, ret0->f1);
218217

219-
if (*ret1 == TAG_NONE) {
218+
if (ret0->f1 == TAG_NONE) {
220219
rb_abi_lend_object(retval);
221220
}
222-
*ret0 = rb_abi_guest_rb_abi_value_new((void *)retval);
221+
ret0->f0 = rb_abi_guest_rb_abi_value_new((void *)retval);
223222
}
224223

225224
rb_abi_guest_rb_id_t rb_abi_guest_rb_intern(rb_abi_guest_string_t *name) {

0 commit comments

Comments
 (0)