Skip to content

Commit

Permalink
uapi: remove println macro from uapi (#96)
Browse files Browse the repository at this point in the history
This is moved to shield rust crate as this is not part of uapi but
higher level runtime feature.
  • Loading branch information
fvalette-ledger authored Nov 26, 2024
2 parents d431e3f + 4363858 commit 4a723a1
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions uapi/uapi/uapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,6 @@ use crate::syscall;
use core::fmt;
use crate::systypes::*;

struct DebugPrint;

impl fmt::Write for DebugPrint {
fn write_str(&mut self, s: &str) -> fmt::Result {
log(s);
Ok(())
}
}

pub fn _print(args: fmt::Arguments) {
use core::fmt::Write;
DebugPrint.write_fmt(args).expect("Print failed");
}

#[macro_export]
macro_rules! print {
($($arg:tt)*) => {
($crate::uapi::_print(format_args!($($arg)*)))
}
}

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

/// Emit an already formatted string through the Sentry kernel std log output
///
/// # Usage
Expand Down

0 comments on commit 4a723a1

Please sign in to comment.