mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-06 12:48:20 +00:00
feat(api,emscritpen,wasi) Update WasmExternType to FromToNativeWasmType.
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user