wasmer/lib/runtime/src/macros.rs
Lachlan Sneff 3563741f4f Remove macro feature that is confusing
This reverts commit fbe480cc08.
2019-01-21 14:50:17 -08:00

24 lines
849 B
Rust

macro_rules! debug {
($fmt:expr) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("wasmer-runtime(:{})::", $fmt), line!()) });
($fmt:expr, $($arg:tt)*) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("wasmer-runtime(:{})::", $fmt, "\n"), line!(), $($arg)*) });
}
#[macro_export]
macro_rules! export_func {
($func:ident, [ $( $params:ident ),* ] -> [ $( $returns:ident ),* ]) => {{
use wasmer_runtime::{
export::{Context, Export, FuncPointer},
types::{FuncSig, Type},
};
Export::Function {
func: FuncPointer::new($func as _),
ctx: Context::Internal,
signature: FuncSig {
params: vec![$(Type::$params,)*],
returns: vec![$(Type::$params,)*],
},
}
}};
}