aboutsummaryrefslogtreecommitdiff
path: root/bunny/src/println.rs
blob: 15f74de849d5db3d1c106a326666a35a167a2c15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#[macro_export]
macro_rules! print {
    ($($arg:tt)*) => ({
        use core::fmt::Write;
        uefi_services::system_table().stdout()
            .write_fmt(format_args!($($arg)*))
            .expect("could not write to console");
    });
}

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

#[macro_export]
macro_rules! dprint {
    ($($arg:tt)*) => ({
        if cfg!(debug_assertions) {
            print!($($arg)*)
        }
    });
}

#[macro_export]
macro_rules! dprintln {
    ($fmt:expr) => (dprint!(concat!($fmt, "\r\n")));
    ($fmt:expr, $($arg:tt)*) => (dprint!(concat!($fmt, "\r\n"), $($arg)*));
}