Skip to content

Commit

Permalink
Added feature std-wasm32
Browse files Browse the repository at this point in the history
  • Loading branch information
mrLSD committed Jun 8, 2022
1 parent 80fa35c commit fd0f84e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ rand = "0.7.3"
[features]
default = ["std"]
std = ["borsh/std", "evm/std", "primitive-types/std", "rlp/std", "sha3/std", "ethabi/std", "logos/std", "bn/std", "aurora-engine-types/std", "rjson/std", "aurora-engine-precompiles/std", "aurora-engine-transactions/std"]
std-wasm32 = []
contract = ["aurora-engine-sdk/contract", "aurora-engine-precompiles/contract"]
evm_bully = []
log = ["aurora-engine-sdk/log", "aurora-engine-precompiles/log"]
tracing = ["evm/tracing"]
meta-call = []
error_refund = ["aurora-engine-precompiles/error_refund"]
integration-test = ["log"]
mainnet = ["contract", "log"]
mainnet = ["contract", "log", "std-wasm32"]
testnet = ["contract", "log"]
mainnet-test = ["meta-call"]
testnet-test = ["meta-call"]
Expand Down
11 changes: 8 additions & 3 deletions engine/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(alloc_error_handler))]
#![cfg_attr(not(any(feature = "std", feature = "std-wasm32")), no_std)]
#![cfg_attr(not(any(feature = "std", feature = "std-wasm32")), feature(alloc_error_handler))]
#![cfg_attr(
all(feature = "log", target_arch = "wasm32"),
all(
all(feature = "log", target_arch = "wasm32"),
not(feature = "std-wasm32")
),
feature(panic_info_message)
)]

Expand Down Expand Up @@ -33,6 +36,7 @@ mod prelude;
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;

#[cfg(target_arch = "wasm32")]
#[cfg(not(feature = "std-wasm32"))]
#[panic_handler]
#[cfg_attr(not(feature = "log"), allow(unused_variables))]
#[no_mangle]
Expand All @@ -57,6 +61,7 @@ pub unsafe fn on_panic(info: &::core::panic::PanicInfo) -> ! {
}

#[cfg(target_arch = "wasm32")]
#[cfg(not(feature = "std-wasm32"))]
#[alloc_error_handler]
#[no_mangle]
pub unsafe fn on_alloc_error(_: core::alloc::Layout) -> ! {
Expand Down

0 comments on commit fd0f84e

Please sign in to comment.