aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-07-29 18:16:41 -0700
committerJoe Wilm <joe@jwilm.com>2016-07-29 18:16:41 -0700
commit9542279f9d4a0391fedc317634fad70082cd07c6 (patch)
treea59b6d5f15520331216e6247580ed8444e862dc3
parentf6cd24eccc25016940968e9aa4307e7d4a7f3aa2 (diff)
downloadalacritty-9542279f9d4a0391fedc317634fad70082cd07c6.tar.gz
alacritty-9542279f9d4a0391fedc317634fad70082cd07c6.zip
Move debug macros to macros.rs
-rw-r--r--src/macros.rs27
-rw-r--r--src/term.rs16
2 files changed, 27 insertions, 16 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)*);
+ }
+ }
+}
+
diff --git a/src/term.rs b/src/term.rs
index 2a431168..744a8bdb 100644
--- a/src/term.rs
+++ b/src/term.rs
@@ -24,22 +24,6 @@ use tty;
use ::Rgb;
-macro_rules! debug_println {
- ($($t:tt)*) => {
- if cfg!(debug_assertions) {
- println!($($t)*);
- }
- }
-}
-
-macro_rules! debug_print {
- ($($t:tt)*) => {
- if cfg!(debug_assertions) {
- print!($($t)*);
- }
- }
-}
-
/// RAII type which manages grid state for render
///
/// This manages the cursor during a render. The cursor location is inverted to