Skip to content

Commit

Permalink
Use alloc::format! (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
joii2020 authored Oct 31, 2024
1 parent ef251e2 commit 99f7031
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@
#[macro_export]
macro_rules! debug {
($fmt:literal) => {
#[cfg(debug_assertions)]
#[cfg(all(debug_assertions, feature = "native-simulator"))]
$crate::syscalls::debug(format!($fmt));
#[cfg(all(debug_assertions, not(feature = "native-simulator")))]
$crate::syscalls::debug(alloc::format!($fmt));
};
($fmt:literal, $($args:expr),+) => {
#[cfg(debug_assertions)]
#[cfg(all(debug_assertions, feature = "native-simulator"))]
$crate::syscalls::debug(format!($fmt, $($args), +));
#[cfg(all(debug_assertions, not(feature = "native-simulator")))]
$crate::syscalls::debug(alloc::format!($fmt, $($args), +));
};
}

0 comments on commit 99f7031

Please sign in to comment.