From 61213706566195eb5b1ff94c15021354dc3e6d9b Mon Sep 17 00:00:00 2001 From: Lachlan Sneff Date: Fri, 23 Nov 2018 00:13:20 -0500 Subject: [PATCH] Fix debug macro warnings --- src/macros.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index a792a0063..94f7dfe61 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -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)*) }); +} \ No newline at end of file