@@ -198,7 +198,7 @@ bool Wasmtime::link(std::string_view debug_name) {
198198 WasmImporttypeVec import_types;
199199 wasm_module_imports (module_.get (), import_types.get ());
200200
201- WasmExternPtrVector imports;
201+ std::vector< const wasm_extern_t *> imports;
202202 for (size_t i = 0 ; i < import_types.get ()->size ; i++) {
203203 const wasm_name_t *module_name_ptr = wasm_importtype_module (import_types.get ()->data [i]);
204204 const wasm_name_t *name_ptr = wasm_importtype_name (import_types.get ()->data [i]);
@@ -233,7 +233,7 @@ bool Wasmtime::link(std::string_view debug_name) {
233233 " -> " + printValTypes (wasm_functype_results (actual_type.get ())));
234234 break ;
235235 }
236- imports.push_back (wasm_func_as_extern (func));
236+ imports.push_back (wasm_func_as_extern_const (func));
237237 } break ;
238238 case WASM_EXTERN_GLOBAL: {
239239 // TODO(mathetake): add support when/if needed.
@@ -246,14 +246,14 @@ bool Wasmtime::link(std::string_view debug_name) {
246246 const wasm_memorytype_t *memory_type =
247247 wasm_externtype_as_memorytype_const (extern_type); // owned by `extern_type`
248248 memory_ = wasm_memory_new (store_.get (), memory_type);
249- imports.push_back (wasm_memory_as_extern (memory_.get ()));
249+ imports.push_back (wasm_memory_as_extern_const (memory_.get ()));
250250 } break ;
251251 case WASM_EXTERN_TABLE: {
252252 assert (table_ == nullptr );
253253 const wasm_tabletype_t *table_type =
254254 wasm_externtype_as_tabletype_const (extern_type); // owned by `extern_type`
255255 table_ = wasm_table_new (store_.get (), table_type, nullptr );
256- imports.push_back (wasm_table_as_extern (table_.get ()));
256+ imports.push_back (wasm_table_as_extern_const (table_.get ()));
257257 } break ;
258258 }
259259 }
@@ -279,9 +279,10 @@ bool Wasmtime::link(std::string_view debug_name) {
279279 assert (kind == wasm_externtype_kind (exp_extern_type));
280280 switch (kind) {
281281 case WASM_EXTERN_FUNC: {
282- wasm_func_t * func = wasm_func_copy (wasm_extern_as_func (actual_extern));
282+ WasmFuncPtr func = wasm_func_copy (wasm_extern_as_func (actual_extern));
283283 const wasm_name_t *name_ptr = wasm_exporttype_name (export_types.get ()->data [i]);
284- module_functions_.insert_or_assign (std::string (name_ptr->data , name_ptr->size ), func);
284+ module_functions_.insert_or_assign (std::string (name_ptr->data , name_ptr->size ),
285+ std::move (func));
285286 } break ;
286287 case WASM_EXTERN_GLOBAL: {
287288 // TODO(mathetake): add support when/if needed.
0 commit comments