aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTianhao Wang <wth@riseup.net>2024-02-01 15:08:30 +0100
committerTianhao Wang <shrik3@mailbox.org>2024-06-11 15:13:36 +0200
commit753955dbb4e6c77b9c56c659fe766a867c575023 (patch)
treefd8e8a443290eb028ab6d8540eb192b3fa854701
parent7194cceeec9721e7c61dde78e5c1da42e16884e2 (diff)
pub(crate) use for println macros
The println! and print! macros are defined in submodule "io", I have to add this trick to make it work across the crate. Maybe there is a better way...
-rw-r--r--src/io.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/io.rs b/src/io.rs
index 988db09..417fc1d 100644
--- a/src/io.rs
+++ b/src/io.rs
@@ -2,7 +2,6 @@ use crate::machine::cgascr::CGAScreen;
use core::fmt;
use lazy_static::lazy_static;
use spin::Mutex;
-
// TODO I want my own locking primitive for practice, instead of stock spin lock
lazy_static! {
// TODO perhaps remove the 'a lifetime from the struc defs
@@ -13,12 +12,14 @@ lazy_static! {
macro_rules! print {
($($arg:tt)*) => ($crate::io::_print(format_args!($($arg)*)));
}
+pub(crate) use print;
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));
($($arg:tt)*) => (print!("{}\n", format_args!($($arg)*)));
}
+pub(crate) use println;
pub fn _print(args: fmt::Arguments) {
use core::fmt::Write;