mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-10 14:48:27 +00:00
feat(c-api) Instruct cbindgen to ignore all functions and types defined in wasm.h.
This commit is contained in:
@@ -9,12 +9,13 @@ use std::slice;
|
||||
use std::sync::Arc;
|
||||
use wasmer::{Module, Store};
|
||||
|
||||
#[repr(C)]
|
||||
/// cbindgen:ignore
|
||||
#[allow(non_camel_case_types)]
|
||||
pub struct wasm_module_t {
|
||||
/// cbindgen:ignore
|
||||
pub(crate) inner: Arc<Module>,
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_module_new(
|
||||
store_ptr: Option<NonNull<wasm_store_t>>,
|
||||
@@ -31,9 +32,11 @@ pub unsafe extern "C" fn wasm_module_new(
|
||||
}))
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_module_delete(_module: Option<Box<wasm_module_t>>) {}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_module_exports(
|
||||
module: &wasm_module_t,
|
||||
@@ -53,6 +56,7 @@ pub unsafe extern "C" fn wasm_module_exports(
|
||||
mem::forget(exports);
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_module_imports(
|
||||
module: &wasm_module_t,
|
||||
@@ -72,6 +76,7 @@ pub unsafe extern "C" fn wasm_module_imports(
|
||||
mem::forget(imports);
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_module_deserialize(
|
||||
store_ptr: Option<NonNull<wasm_store_t>>,
|
||||
@@ -97,6 +102,7 @@ pub unsafe extern "C" fn wasm_module_deserialize(
|
||||
))))
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_module_serialize(
|
||||
module: &wasm_module_t,
|
||||
|
||||
Reference in New Issue
Block a user