Update to Wasmer 3.0 beta
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -2,13 +2,13 @@ use std::sync::Arc;
|
||||
|
||||
use parking_lot::RwLock;
|
||||
use paste::paste;
|
||||
use wasmer::NativeFunc;
|
||||
|
||||
use crate::dynamic_data::{DynamicLibrary, TurnChoice};
|
||||
use crate::script_implementations::wasm::extern_ref::{ExternRef, VecExternRef};
|
||||
use crate::script_implementations::wasm::script_resolver::WebAssemblyEnvironmentData;
|
||||
use crate::static_data::EffectParameter;
|
||||
use crate::StringKey;
|
||||
use wasmer::TypedFunction;
|
||||
|
||||
/// A macro to generate the script function cache a bit easier.
|
||||
macro_rules! script_function_cache {
|
||||
@@ -21,7 +21,7 @@ macro_rules! script_function_cache {
|
||||
#[allow(unused_parens)]
|
||||
pub struct ScriptFunctionCache {
|
||||
$(
|
||||
$name: RwLock<Option<NativeFunc<(u32$(, $par_type)*), ()>>>,
|
||||
$name: RwLock<Option<TypedFunction<(u32$(, $par_type)*), ()>>>,
|
||||
)*
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ macro_rules! script_function_cache {
|
||||
let exported = env.exported_functions();
|
||||
let f = exported.get::<StringKey>(&stringify!([< script_ $name >]).into());
|
||||
if let Some(f) = f {
|
||||
let func: NativeFunc<(u32 $(,$par_type)*), ()> = f.native().unwrap();
|
||||
let func: TypedFunction<(u32 $(,$par_type)*), ()> = f.typed(&env.store_ref()).unwrap();
|
||||
let _ = self.$name.write().insert(func);
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ macro_rules! script_function_cache {
|
||||
pub(crate) fn [<$name>](
|
||||
&self,
|
||||
env: &Arc<WebAssemblyEnvironmentData>,
|
||||
) -> Option<NativeFunc<(u32 $(,$par_type)*), ()>> {
|
||||
) -> Option<TypedFunction<(u32 $(,$par_type)*), ()>> {
|
||||
{
|
||||
let read_lock = self.$name.read();
|
||||
if let Some(f) = read_lock.as_ref() {
|
||||
|
||||
Reference in New Issue
Block a user