rust modules

This commit is contained in:
2023-12-06 16:39:55 +01:00
parent 0f99bff211
commit 7aec5819c6
7 changed files with 282 additions and 269 deletions

View File

@ -0,0 +1,35 @@
pub struct Outbytes {}
use core::fmt::{Error, Write};
impl Write for Outbytes {
fn write_str(&mut self, s: &str) -> Result<(), Error> {
for c in s.as_bytes() {
unsafe {
crate::fsrc::osal::outbyte(*c);
}
}
Ok(())
}
}
#[macro_export]
macro_rules! sifln {
($(,)?) => (
let mut stdout = Outbytes {};
writeln!(stdout);
);
($($arg:tt)*) => (
let mut stdout = crate::fsrc::sif::Outbytes {};
let _alwaysok = writeln!(stdout, $($arg)*);
);
}
#[macro_export]
macro_rules! sif {
($($arg:tt)*) => (
let mut stdout = crate::fsrc::sif::Outbytes {};
let _alwaysok = write!(stdout, $($arg)*);
);
}