no_std support
This commit is contained in:
parent
8247be32f9
commit
41d3711ac7
@ -6,6 +6,10 @@ edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = []
|
||||
|
||||
[dependencies]
|
||||
afl = { path = "../../" }
|
||||
|
||||
|
@ -1,6 +1,11 @@
|
||||
use std::boxed::Box;
|
||||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::boxed::Box;
|
||||
use alloc::rc::Rc;
|
||||
use core::cell::RefCell;
|
||||
|
||||
use afl::corpus::{Corpus, InMemoryCorpus, Testcase};
|
||||
use afl::engines::{DefaultEngine, DefaultState, Engine, State};
|
||||
@ -62,5 +67,7 @@ pub extern "C" fn afl_libfuzzer_main() {
|
||||
.fuzz_one(&mut state)
|
||||
.expect(&format!("Error in iter {}", i));
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
println!("OK");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user