mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-12 13:28:49 +00:00
fix(c-api) Adjust cbindgen metadata for header files.
This commit is contained in:
@@ -384,6 +384,7 @@ fn exclude_items_from_wasm_c_api(mut builder: Builder) -> Builder {
|
||||
.exclude_item("wasi_env_t")
|
||||
.exclude_item("wasi_get_imports")
|
||||
.exclude_item("wasi_get_imports_inner")
|
||||
.exclude_item("wasi_get_start_function")
|
||||
.exclude_item("wasi_get_wasi_version")
|
||||
.exclude_item("wasi_version_t");
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ use super::super::instance::wasm_instance_t;
|
||||
use wasmer::FrameInfo;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[repr(C)]
|
||||
pub struct wasm_frame_t {
|
||||
info: FrameInfo,
|
||||
}
|
||||
@@ -19,30 +18,36 @@ impl From<FrameInfo> for wasm_frame_t {
|
||||
}
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_frame_copy(frame: &wasm_frame_t) -> Box<wasm_frame_t> {
|
||||
Box::new(frame.clone())
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_frame_delete(_frame: Option<Box<wasm_frame_t>>) {}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_frame_instance(frame: &wasm_frame_t) -> *const wasm_instance_t {
|
||||
//todo!("wasm_frame_instance")
|
||||
std::ptr::null()
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_frame_func_index(frame: &wasm_frame_t) -> u32 {
|
||||
frame.info.func_index()
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_frame_func_offset(frame: &wasm_frame_t) -> usize {
|
||||
frame.info.func_offset()
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_frame_module_offset(frame: &wasm_frame_t) -> usize {
|
||||
frame.info.module_offset()
|
||||
|
||||
@@ -299,5 +299,7 @@ pub unsafe extern "C" fn wasi_get_start_function(
|
||||
}
|
||||
|
||||
/// Delete a `wasm_extern_t` allocated by the API.
|
||||
///
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_extern_delete(_item: Option<Box<wasm_extern_t>>) {}
|
||||
|
||||
@@ -124,6 +124,10 @@ bool wasi_get_imports(wasm_store_t *store,
|
||||
wasm_extern_t **imports);
|
||||
#endif
|
||||
|
||||
#if defined(WASMER_WASI_ENABLED)
|
||||
wasm_func_t *wasi_get_start_function(wasm_instance_t *instance);
|
||||
#endif
|
||||
|
||||
#if defined(WASMER_WASI_ENABLED)
|
||||
wasi_version_t wasi_get_wasi_version(const wasm_module_t *module);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user