From 1ecb4ca2509368d5713628e2fa540e8d3d03e7d2 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Fri, 9 Oct 2020 14:51:53 +0200 Subject: [PATCH] feat(c-api) Implement `wasm_externtype_copy`. --- lib/c-api/src/wasm_c_api/types/extern_.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/c-api/src/wasm_c_api/types/extern_.rs b/lib/c-api/src/wasm_c_api/types/extern_.rs index 97692de73fb..3f78ad11f9a 100644 --- a/lib/c-api/src/wasm_c_api/types/extern_.rs +++ b/lib/c-api/src/wasm_c_api/types/extern_.rs @@ -21,6 +21,15 @@ pub unsafe extern "C" fn wasm_extern_type(e: &wasm_extern_t) -> Box>) {} +#[no_mangle] +pub extern "C" fn wasm_externtype_copy( + wasm_externtype: &wasm_externtype_t, +) -> Box { + Box::new(wasm_externtype_t { + inner: wasm_externtype.inner.clone(), + }) +} + impl From for wasm_externtype_t { fn from(other: ExternType) -> Self { Self { inner: other }