Begin work on no_std support.
This adds no_std support to a bunch of things, but more work is needed.
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
//! JIT-style runtime for WebAssembly using Cranelift.
|
||||
|
||||
#![deny(
|
||||
missing_docs,
|
||||
trivial_numeric_casts,
|
||||
unused_extern_crates,
|
||||
unstable_features
|
||||
)]
|
||||
#![deny(missing_docs, trivial_numeric_casts, unused_extern_crates)]
|
||||
#![warn(unused_import_braces)]
|
||||
#![cfg_attr(feature = "std", deny(unstable_features))]
|
||||
#![cfg_attr(
|
||||
feature = "clippy",
|
||||
plugin(clippy(conf_file = "../../clippy.toml"))
|
||||
@@ -28,6 +24,8 @@
|
||||
use_self
|
||||
)
|
||||
)]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg_attr(not(feature = "std"), feature(alloc))]
|
||||
|
||||
extern crate cranelift_codegen;
|
||||
extern crate cranelift_entity;
|
||||
@@ -35,6 +33,9 @@ extern crate cranelift_wasm;
|
||||
extern crate memmap;
|
||||
extern crate region;
|
||||
extern crate wasmtime_environ;
|
||||
#[cfg(not(feature = "std"))]
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
|
||||
mod execute;
|
||||
mod instance;
|
||||
@@ -42,3 +43,10 @@ mod memory;
|
||||
|
||||
pub use execute::{compile_and_link_module, execute};
|
||||
pub use instance::Instance;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
mod std {
|
||||
pub use alloc::{string, vec};
|
||||
pub use core::*;
|
||||
pub use core::{i32, str, u32};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user