mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-09 22:28:21 +00:00
feat(c-api) Instruct cbindgen to ignore all functions and types defined in wasm.h.
This commit is contained in:
@@ -3,10 +3,12 @@ use std::convert::{TryFrom, TryInto};
|
||||
use std::ptr::NonNull;
|
||||
use wasmer::Val;
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[allow(non_camel_case_types)]
|
||||
pub type wasm_valkind_t = u8;
|
||||
|
||||
#[repr(C)]
|
||||
/// cbindgen:ignore
|
||||
#[allow(non_camel_case_types)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub union wasm_val_inner {
|
||||
pub(crate) int32_t: i32,
|
||||
@@ -16,7 +18,8 @@ pub union wasm_val_inner {
|
||||
pub(crate) wref: *mut wasm_ref_t,
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
/// cbindgen:ignore
|
||||
#[allow(non_camel_case_types)]
|
||||
pub struct wasm_val_t {
|
||||
pub(crate) kind: wasm_valkind_t,
|
||||
pub(crate) of: wasm_val_inner,
|
||||
@@ -31,6 +34,7 @@ impl Clone for wasm_val_t {
|
||||
}
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_val_copy(out_ptr: *mut wasm_val_t, val: &wasm_val_t) {
|
||||
(*out_ptr).kind = val.kind;
|
||||
@@ -46,6 +50,7 @@ pub unsafe extern "C" fn wasm_val_copy(out_ptr: *mut wasm_val_t, val: &wasm_val_
|
||||
};
|
||||
}
|
||||
|
||||
/// cbindgen:ignore
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn wasm_val_delete(val: Option<NonNull<wasm_val_t>>) {
|
||||
if let Some(v_inner) = val {
|
||||
|
||||
Reference in New Issue
Block a user