Skip to content

Commit

Permalink
Merge #1659
Browse files Browse the repository at this point in the history
1659: Remove `extern "C"` from a non-pub function that returns non-FFI'able type. r=nlewycky a=nlewycky

Remove `extern "C"` from a non-pub function that returns non-FFI'able type.

Add `extern "C"` to two `#[no_mangle] pub` functions.


Co-authored-by: Nick Lewycky <[email protected]>
  • Loading branch information
bors[bot] and nlewycky authored Sep 29, 2020
2 parents 293d49c + 00741f0 commit 12bc562
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/c-api/src/wasm_c_api/wasi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ pub unsafe extern "C" fn wasi_get_imports(
}

/// Takes ownership of `wasi_env_t`.
unsafe extern "C" fn wasi_get_imports_inner(
unsafe fn wasi_get_imports_inner(
store: Option<NonNull<wasm_store_t>>,
module: &wasm_module_t,
wasi_env: &wasi_env_t,
Expand Down Expand Up @@ -286,7 +286,9 @@ unsafe extern "C" fn wasi_get_imports_inner(
}

#[no_mangle]
pub unsafe fn wasi_get_start_function(instance: &mut wasm_instance_t) -> Option<Box<wasm_func_t>> {
pub unsafe extern "C" fn wasi_get_start_function(
instance: &mut wasm_instance_t,
) -> Option<Box<wasm_func_t>> {
let f = c_try!(instance.inner.exports.get_function("_start"));
Some(Box::new(wasm_func_t {
inner: f.clone(),
Expand All @@ -296,4 +298,4 @@ pub unsafe fn wasi_get_start_function(instance: &mut wasm_instance_t) -> Option<

/// Delete a `wasm_extern_t` allocated by the API.
#[no_mangle]
pub unsafe fn wasm_extern_delete(_item: Option<Box<wasm_extern_t>>) {}
pub unsafe extern "C" fn wasm_extern_delete(_item: Option<Box<wasm_extern_t>>) {}

0 comments on commit 12bc562

Please sign in to comment.