mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 05:08:19 +00:00
Emscripten compiles with no errors!
This commit is contained in:
@@ -81,12 +81,32 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
/// Marker trait to make Rust happy: required to allow `NativeFunc<i32>` work.
|
||||
/// without this trait, the singleton case looks like a generic impl in the macro
|
||||
/// expansion and Rust will not compile this code because it's a potential duplicate
|
||||
/// with all the existing tuples for which this is also being implemented.
|
||||
pub unsafe trait WasmExternTypeInner: Copy + WasmExternType
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
}
|
||||
unsafe impl WasmExternTypeInner for i8 {}
|
||||
unsafe impl WasmExternTypeInner for u8 {}
|
||||
unsafe impl WasmExternTypeInner for i16 {}
|
||||
unsafe impl WasmExternTypeInner for u16 {}
|
||||
unsafe impl WasmExternTypeInner for i32 {}
|
||||
unsafe impl WasmExternTypeInner for u32 {}
|
||||
unsafe impl WasmExternTypeInner for i64 {}
|
||||
unsafe impl WasmExternTypeInner for u64 {}
|
||||
unsafe impl WasmExternTypeInner for f32 {}
|
||||
unsafe impl WasmExternTypeInner for f64 {}
|
||||
|
||||
macro_rules! impl_native_traits {
|
||||
( $( $x:ident ),* ) => {
|
||||
#[allow(unused_parens, non_snake_case)]
|
||||
impl<'a $( , $x )*, Rets> NativeFunc<'a, ( $( $x, )* ), Rets>
|
||||
impl<'a $( , $x )*, Rets> NativeFunc<'a, ( $( $x ),* ), Rets>
|
||||
where
|
||||
$( $x: WasmExternType, )*
|
||||
$( $x: WasmExternType + WasmExternTypeInner, )*
|
||||
Rets: WasmTypeList,
|
||||
{
|
||||
/// Call the typed func and return results.
|
||||
|
||||
Reference in New Issue
Block a user