c-api: refactor definitions with macroes (#4416)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
This commit is contained in:
@@ -40,6 +40,8 @@ pub struct wasi_config_t {
|
||||
inherit_stderr: bool,
|
||||
}
|
||||
|
||||
wasmtime_c_api_macros::declare_own!(wasi_config_t);
|
||||
|
||||
impl wasi_config_t {
|
||||
pub fn into_wasi_ctx(self) -> Result<WasiCtx> {
|
||||
let mut builder = WasiCtxBuilder::new();
|
||||
@@ -100,9 +102,6 @@ pub extern "C" fn wasi_config_new() -> Box<wasi_config_t> {
|
||||
Box::new(wasi_config_t::default())
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wasi_config_delete(_config: Box<wasi_config_t>) {}
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasi_config_set_argv(
|
||||
config: &mut wasi_config_t,
|
||||
|
||||
Reference in New Issue
Block a user