From ea5e45d975ed81bf8cdc4eea894e7a9901451124 Mon Sep 17 00:00:00 2001 From: "Zone.N" Date: Tue, 5 Mar 2024 03:24:37 +0800 Subject: [PATCH] fix(boot): define ostream debug in cpp Signed-off-by: Zone.N --- src/boot/include/ostream.hpp | 2 +- src/boot/ostream.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/boot/include/ostream.hpp b/src/boot/include/ostream.hpp index 0fe11dbcd..0b5cf7e5c 100644 --- a/src/boot/include/ostream.hpp +++ b/src/boot/include/ostream.hpp @@ -201,6 +201,6 @@ inline auto ostream::operator<<(const void *_val) -> ostream & { /// @} /// 全局输出流 -static ostream debug; +extern ostream debug; #endif /* SIMPLEKERNEL_OSTREAM_HPP */ diff --git a/src/boot/ostream.cpp b/src/boot/ostream.cpp index b52707610..dd49b60da 100644 --- a/src/boot/ostream.cpp +++ b/src/boot/ostream.cpp @@ -40,3 +40,6 @@ auto ostream::hex_X(ostream &_ostream) -> ostream & { } auto ostream::endl(ostream &_ostream) -> ostream & { return _ostream << L'\n'; } + +/// 全局输出流 +ostream debug;