// Copyright 2019 The ChromiumOS Authors1// Use of this source code is governed by a BSD-style license that can be2// found in the LICENSE file.34pub mod rand;56cfg_if::cfg_if! {7if #[cfg(not(fuzzing))] {8/// A stub implementation that ensures the fuzzer code can be compiled but does not provide9/// any fuzzing functionality.10/// This allows the fuzzer code to be verified in CI without a nightly cargo toolchain.11#[macro_export]12macro_rules! fuzz_target {13(|$bytes:ident| $body:block) => {14// fuzzers are configured with no_main. To make the binary compile, we manually15// provide the main function with no_mangle.16#[no_mangle]17pub extern fn main($bytes: &[u8]) {18$body19}20};21(|$bytes:ident: &[u8]| $body:block) => {22fuzz_target!(|$bytes| $body);23};24}25} else {26pub use libfuzzer_sys::fuzz_target;27}28}293031