diff options
author | Joe Wilm <joe@jwilm.com> | 2016-07-29 18:16:41 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-07-29 18:16:41 -0700 |
commit | 9542279f9d4a0391fedc317634fad70082cd07c6 (patch) | |
tree | a59b6d5f15520331216e6247580ed8444e862dc3 /src/macros.rs | |
parent | f6cd24eccc25016940968e9aa4307e7d4a7f3aa2 (diff) | |
download | alacritty-9542279f9d4a0391fedc317634fad70082cd07c6.tar.gz alacritty-9542279f9d4a0391fedc317634fad70082cd07c6.zip |
Move debug macros to macros.rs
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)*); + } + } +} + |