diff options
Diffstat (limited to 'src/macros.rs')
-rw-r--r-- | src/macros.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/macros.rs b/src/macros.rs index 8abad78d..97c317b2 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -27,3 +27,30 @@ macro_rules! err_println { (writeln!(&mut ::std::io::stderr(), $($arg)*)).expect("stderr"); }} } + +#[macro_export] +macro_rules! err_println { + ($($arg:tt)*) => {{ + use std::io::Write; + (writeln!(&mut ::std::io::stderr(), $($arg)*)).expect("stderr"); + }} +} + +#[macro_export] +macro_rules! debug_println { + ($($t:tt)*) => { + if cfg!(debug_assertions) { + println!($($t)*); + } + } +} + +#[macro_export] +macro_rules! debug_print { + ($($t:tt)*) => { + if cfg!(debug_assertions) { + print!($($t)*); + } + } +} + |