c-api: refactor definitions with macroes (#4416)

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
This commit is contained in:
罗泽轩
2022-07-11 22:10:41 +08:00
committed by GitHub
parent 6c70428735
commit 1d319c0ec2
5 changed files with 10 additions and 54 deletions

View File

@@ -60,6 +60,8 @@ pub struct wasmtime_store_t {
pub(crate) store: Store<StoreData>,
}
wasmtime_c_api_macros::declare_own!(wasmtime_store_t);
pub type CStoreContext<'a> = StoreContext<'a, StoreData>;
pub type CStoreContextMut<'a> = StoreContextMut<'a, StoreData>;
@@ -77,9 +79,6 @@ pub struct StoreData {
pub wasm_val_storage: Vec<Val>,
}
#[no_mangle]
pub extern "C" fn wasmtime_store_delete(_: Box<wasmtime_store_t>) {}
#[no_mangle]
pub extern "C" fn wasmtime_store_new(
engine: &wasm_engine_t,