Merge branch 'devel' into 'master'

feat(dbg): lift the latest version

See merge request redox-os/relibc!576
This commit is contained in:
Jeremy Soller
2024-12-11 13:49:40 +00:00
+10 -2
View File
@@ -45,8 +45,12 @@ macro_rules! eprintln {
/// Lifted from libstd
#[macro_export]
macro_rules! dbg {
// NOTE: We cannot use `concat!` to make a static string as a format argument
// of `eprintln!` because `file!` could contain a `{` or
// `$val` expression could be a block (`{ .. }`), in which case the `eprintln!`
// will be malformed.
() => {
eprintln!("[{}:{}]", file!(), line!());
eprintln!("[{}:{}:{}]", file!(), line!(), column!());
};
($val:expr) => {
// Use of `match` here is intentional because it affects the lifetimes
@@ -54,9 +58,10 @@ macro_rules! dbg {
match $val {
tmp => {
eprintln!(
"[{}:{}] {} = {:#?}",
"[{}:{}:{}] {} = {:#?}",
file!(),
line!(),
column!(),
stringify!($val),
&tmp
);
@@ -64,6 +69,9 @@ macro_rules! dbg {
}
}
};
($($val:expr),+ $(,)?) => {
($(dbg!($val)),+,)
};
}
#[macro_export]