feat(api,emscritpen,wasi) Update WasmExternType to FromToNativeWasmType.

This commit is contained in:
Ivan Enderlin
2020-06-30 12:10:27 +02:00
parent 12c04fbd94
commit 3f924dbb45
7 changed files with 14 additions and 14 deletions

View File

@@ -6,7 +6,7 @@
#![allow(dead_code)]
use std::{cell::Cell, fmt};
pub use wasmer::{Array, Memory, ValueType, WasmExternType};
pub use wasmer::{Array, FromToNativeWasmType, Memory, ValueType};
#[repr(transparent)]
pub struct WasmPtr<T: Copy, Ty = wasmer::Item>(wasmer::WasmPtr<T, Ty>);
@@ -26,8 +26,8 @@ impl<T: Copy, Ty> fmt::Debug for WasmPtr<T, Ty> {
}
}
unsafe impl<T: Copy, Ty> WasmExternType for WasmPtr<T, Ty> {
type Native = <wasmer::WasmPtr<T, Ty> as WasmExternType>::Native;
unsafe impl<T: Copy, Ty> FromToNativeWasmType for WasmPtr<T, Ty> {
type Native = <wasmer::WasmPtr<T, Ty> as FromToNativeWasmType>::Native;
fn to_native(self) -> Self::Native {
self.0.to_native()

View File

@@ -1,6 +1,6 @@
use crate::EmEnv;
use std::mem;
use wasmer::WasmExternType;
use wasmer::FromToNativeWasmType;
// use std::ffi::CStr;
use std::os::raw::c_char;
@@ -26,7 +26,7 @@ impl VarArgs {
}
}
unsafe impl WasmExternType for VarArgs {
unsafe impl FromToNativeWasmType for VarArgs {
type Native = i32;
fn to_native(self) -> Self::Native {