feat(c-api) Instruct cbindgen to ignore all functions and types defined in wasm.h.

This commit is contained in:
Ivan Enderlin
2020-09-28 14:49:44 +02:00
parent 40865799e6
commit 8f627d9834
24 changed files with 178 additions and 55 deletions

View File

@@ -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,