Skip to content

Commit 83f33b5

Browse files
committed
Fix some minor C API mistakes
* Remove stray `struct wasmtime_eqref` * Remove header definition for `wasmtime_anyref_to_eqref` as it doesn't exist. The function is actually `wasmtime_anyref_as_eqref` which has tests and such. * Define `wasm_tagtype_vec_*` functions.
1 parent 3a1920b commit 83f33b5

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

crates/c-api/include/wasmtime/val.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ extern "C" {
1616
#endif
1717

1818
#ifdef WASMTIME_FEATURE_GC
19-
struct wasmtime_eqref;
2019
/// Convenience alias for #wasmtime_eqref
2120
typedef struct wasmtime_eqref wasmtime_eqref_t;
2221

@@ -82,19 +81,6 @@ static inline bool wasmtime_anyref_is_null(const wasmtime_anyref_t *ref) {
8281
WASM_API_EXTERN void wasmtime_anyref_clone(const wasmtime_anyref_t *anyref,
8382
wasmtime_anyref_t *out);
8483

85-
/**
86-
* \brief Downcast an `anyref` to an `eqyref`.
87-
*
88-
* Returns `true` if the downcast succeeded, and `out` is initialized. Returns
89-
* `false` if the downcast failed, and `out` is left uninitialized.
90-
*
91-
* The original `anyref` is not consumed; `out` receives a new cloned root
92-
* pointing to the same GC object as `anyref`.
93-
*/
94-
WASM_API_EXTERN bool wasmtime_anyref_to_eqref(wasmtime_context_t *context,
95-
const wasmtime_anyref_t *anyref,
96-
wasmtime_eqref_t *out);
97-
9884
/**
9985
* \brief Unroots the `ref` provided within the `context`.
10086
*

crates/c-api/src/vec.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::{
22
wasm_exporttype_t, wasm_extern_t, wasm_externtype_t, wasm_frame_t, wasm_functype_t,
3-
wasm_globaltype_t, wasm_importtype_t, wasm_memorytype_t, wasm_tabletype_t, wasm_val_t,
4-
wasm_valtype_t,
3+
wasm_globaltype_t, wasm_importtype_t, wasm_memorytype_t, wasm_tabletype_t, wasm_tagtype_t,
4+
wasm_val_t, wasm_valtype_t,
55
};
66
use std::mem;
77
use std::mem::MaybeUninit;
@@ -260,4 +260,13 @@ declare_vecs! {
260260
copy: wasm_extern_vec_copy,
261261
delete: wasm_extern_vec_delete,
262262
)
263+
(
264+
name: wasm_tagtype_vec_t,
265+
ty: Option<Box<wasm_tagtype_t>>,
266+
new: wasm_tagtype_vec_new,
267+
empty: wasm_tagtype_vec_new_empty,
268+
uninit: wasm_tagtype_vec_new_uninitialized,
269+
copy: wasm_tagtype_vec_copy,
270+
delete: wasm_tagtype_vec_delete,
271+
)
263272
}

0 commit comments

Comments
 (0)