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

@@ -8,9 +8,9 @@ use std::ptr::NonNull;
use std::sync::Arc;
use wasmer::{Extern, Instance};
#[repr(C)]
/// cbindgen:ignore
#[allow(non_camel_case_types)]
pub struct wasm_instance_t {
/// cbindgen:ignore
pub(crate) inner: Arc<Instance>,
}
@@ -51,6 +51,7 @@ unsafe fn argument_import_iter(
.unwrap_or_else(|| Box::new(std::iter::empty()) as _)
}
/// cbindgen:ignore
#[no_mangle]
pub unsafe extern "C" fn wasm_instance_new(
store: Option<NonNull<wasm_store_t>>,
@@ -73,9 +74,11 @@ pub unsafe extern "C" fn wasm_instance_new(
Some(Box::new(wasm_instance_t { inner: instance }))
}
/// cbindgen:ignore
#[no_mangle]
pub unsafe extern "C" fn wasm_instance_delete(_instance: Option<Box<wasm_instance_t>>) {}
/// cbindgen:ignore
#[no_mangle]
pub unsafe extern "C" fn wasm_instance_exports(
instance: &wasm_instance_t,