Use target_family for wasm.

This commit is contained in:
Stephen Chung
2022-01-12 08:12:28 +08:00
parent f0e9d4a557
commit 37dbc68bf5
18 changed files with 82 additions and 101 deletions

View File

@@ -41,8 +41,8 @@
//! engine.register_fn("compute", compute_something);
//!
//! # #[cfg(not(feature = "no_std"))]
//! # #[cfg(not(target_arch = "wasm32"))]
//! # #[cfg(not(target_arch = "wasm64"))]
//! # #[cfg(not(target_family = "wasm"))]
//! #
//! // Evaluate the script, expecting a 'bool' result
//! let result = engine.eval_file::<bool>("my_script.rhai".into())?;
//!
@@ -365,17 +365,15 @@ compile_error!("`wasm-bindgen` cannot be used with `no-std`");
#[cfg(feature = "stdweb")]
compile_error!("`stdweb` cannot be used with `no-std`");
#[cfg(any(target_arch = "wasm32", target_arch = "wasm64"))]
#[cfg(target_family = "wasm")]
#[cfg(feature = "no_std")]
compile_error!("`no_std` cannot be used for WASM target");
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_arch = "wasm64"))]
#[cfg(not(target_family = "wasm"))]
#[cfg(feature = "wasm-bindgen")]
compile_error!("`wasm-bindgen` cannot be used for non-WASM target");
#[cfg(not(target_arch = "wasm32"))]
#[cfg(not(target_arch = "wasm64"))]
#[cfg(not(target_family = "wasm"))]
#[cfg(feature = "stdweb")]
compile_error!("`stdweb` cannot be used non-WASM target");