From 10cc4d27eec03b358c5e8cf4d093a19a9208676f 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 | 10 ++++++++++ 1 file changed, 10 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..1d7854d92f9 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,16 @@ pub unsafe extern "C" fn wasm_extern_type(e: &wasm_extern_t) -> Box>) {} +#[no_mangle] +pub unsafe extern "C" fn wasm_externtype_copy( + wasm_externtype: &wasm_externtype_t, +) -> Box { + // do shallow copy + Box::new(wasm_externtype_t { + inner: wasm_externtype.inner.clone(), + }) +} + impl From for wasm_externtype_t { fn from(other: ExternType) -> Self { Self { inner: other }