mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-15 15:15:40 +00:00
3563741f4f
This reverts commit fbe480cc08
.
24 lines
849 B
Rust
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,)*],
|
|
},
|
|
}
|
|
}};
|
|
}
|