mirror of
https://github.com/fluencelabs/wasm-utils
synced 2025-06-30 15:01:39 +00:00
Port core util lib to support no_std
This commit is contained in:
17
src/lib.rs
17
src/lib.rs
@ -1,3 +1,10 @@
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![cfg_attr(not(feature = "std"), feature(alloc))]
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
|
||||
extern crate parity_wasm;
|
||||
extern crate byteorder;
|
||||
#[macro_use] extern crate log;
|
||||
@ -22,3 +29,13 @@ pub use gas::inject_gas_counter;
|
||||
pub use ext::{externalize, externalize_mem, underscore_funcs, ununderscore_funcs, shrink_unknown_stack};
|
||||
pub use pack::{pack_instance, Error as PackingError};
|
||||
pub use runtime_type::inject_runtime_type;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
mod std {
|
||||
pub use core::*;
|
||||
pub use alloc::{vec, string, boxed, borrow};
|
||||
|
||||
pub mod collections {
|
||||
pub use alloc::{BTreeMap, BTreeSet};
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user