From 19eb7d18142572f7ff84277d494d24f376f68b5b Mon Sep 17 00:00:00 2001 From: ccgauche Date: Sun, 10 Jan 2021 21:49:10 +0100 Subject: [PATCH] Fixed tests on WIndows due to target arch wasm32 --- plugin/rt/src/lib.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugin/rt/src/lib.rs b/plugin/rt/src/lib.rs index bf7d4cdd09..f0e962524b 100644 --- a/plugin/rt/src/lib.rs +++ b/plugin/rt/src/lib.rs @@ -7,16 +7,20 @@ pub use plugin_derive::*; use serde::{de::DeserializeOwned, Serialize}; +#[cfg(target_arch = "wasm32")] extern "C" { fn raw_emit_actions(ptr: *const u8, len: usize); } pub fn emit_action(action: api::Action) { emit_actions(vec![action]) } -pub fn emit_actions(actions: Vec) { - let ret = bincode::serialize(&actions).expect("Can't serialize action in emit"); - unsafe { - raw_emit_actions(ret.as_ptr(), ret.len()); +pub fn emit_actions(_actions: Vec) { + #[cfg(target_arch = "wasm32")] + { + let ret = bincode::serialize(&_actions).expect("Can't serialize action in emit"); + unsafe { + raw_emit_actions(ret.as_ptr(), ret.len()); + } } }