Skip to content

Commit

Permalink
Fix debug macro warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlansneff committed Nov 23, 2018
1 parent 587fb92 commit 6121370
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,8 @@ macro_rules! include_wast2wasm_bytes {
}};
}

#[cfg(debug_assertions)]
#[macro_export]
macro_rules! debug {
($fmt:expr) => (println!(concat!("Wasmer::", $fmt)));
($fmt:expr, $($arg:tt)*) => (println!(concat!("Wasmer::", $fmt, "\n"), $($arg)*));
}

#[cfg(not(debug_assertions))]
#[macro_export]
macro_rules! debug {
($fmt:expr) => {};
($fmt:expr, $($arg:tt)*) => {};
}
($fmt:expr) => (if cfg!(debug_assertions) { println!(concat!("Wasmer::", $fmt)) });
($fmt:expr, $($arg:tt)*) => (if cfg!(debug_assertions) { println!(concat!("Wasmer::", $fmt, "\n"), $($arg)*) });
}

0 comments on commit 6121370

Please sign in to comment.