mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-09 14:18:20 +00:00
feat(c-api) Remove the deprecated API.
Until this patch, our C API comes in 2 flavors: `deprecated` and `wasm_c_api`. With the coming 2.x version of Wasmer, we would like to remove the `deprecated` API, and keep the `wasm_c_api` only. This patch removes the `deprecated` API from the `wasmer-c-api` crate. It also cleans up the `Makefile` and the documentation system. Previously, the documentation for the `deprecated` API was relying on Doxygen, which was one new dependency the user had to install. For the `wasm_c_api`, it relies on `rustdoc`, which is way better because all examples are run and tested as part of our test suite. This clean up also removes the need to deal with `system-libffi` both in the crate itself and in the `Makefile`, which was an edge case for macOS on aarch64, and a needle in the foot for some of our users. Finally, the `build.rs` is now simplified because we no longer need to exclude symbols from one header to another. It also means that we only provide the `wasmer_wasm.h` header file now; the `wasmer.h` and `wasmer.hh` headers are removed.
This commit is contained in:
@@ -184,15 +184,7 @@ pub unsafe extern "C" fn wasm_instance_exports(
|
||||
let mut extern_vec = instance
|
||||
.exports
|
||||
.iter()
|
||||
.map(|(name, r#extern)| {
|
||||
let function = if let Extern::Function { .. } = r#extern {
|
||||
instance.exports.get_function(&name).ok().cloned()
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
Box::into_raw(Box::new(r#extern.clone().into()))
|
||||
})
|
||||
.map(|(_name, r#extern)| Box::into_raw(Box::new(r#extern.clone().into())))
|
||||
.collect::<Vec<*mut wasm_extern_t>>();
|
||||
extern_vec.shrink_to_fit();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user