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

@@ -127,6 +127,8 @@ pub struct wasmtime_module_t {
pub(crate) module: Module,
}
wasmtime_c_api_macros::declare_own!(wasmtime_module_t);
#[no_mangle]
pub unsafe extern "C" fn wasmtime_module_new(
engine: &wasm_engine_t,
@@ -142,9 +144,6 @@ pub unsafe extern "C" fn wasmtime_module_new(
)
}
#[no_mangle]
pub extern "C" fn wasmtime_module_delete(_module: Box<wasmtime_module_t>) {}
#[no_mangle]
pub extern "C" fn wasmtime_module_clone(module: &wasmtime_module_t) -> Box<wasmtime_module_t> {
Box::new(module.clone())