Skip to content

Commit

Permalink
Declare extern std if RustAdvancedLoggerDxe is build with std enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
joschock committed Dec 1, 2023
1 parent 17b254f commit 1c35bf1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions AdvLoggerPkg/Crates/RustAdvancedLoggerDxe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//!
#![no_std]

#[cfg(doc)]
#[cfg(any(doc, feature = "std"))]
extern crate std; //allow rustdoc links to reference std (e.g. println docs below).

use core::{
Expand Down Expand Up @@ -173,8 +173,6 @@ mod no_std_debug {

#[cfg(feature = "std")]
mod std_debug {
extern crate std;

/// Prints to the console log.
///
/// This macro uses the same syntax as rust std [`std::println!`] macro, with the addition of a level argument that
Expand Down Expand Up @@ -203,7 +201,7 @@ mod std_debug {
macro_rules! debug {
($level:expr, $($arg:tt)*) => {
let _ = $level;
print!($($arg)*)
std::print!($($arg)*)
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ resolver = "2"

# Add packages that generate binaries here
members = [
"HidPkg/Crates/HidIo",
"HidPkg/Crates/HiiKeyboardLayout",
"HidPkg/UefiHidDxe",
# "HidPkg/Crates/HidIo",
# "HidPkg/Crates/HiiKeyboardLayout",
# "HidPkg/UefiHidDxe",
"HidPkg/UefiHidDxeV2",
"MsCorePkg/HelloWorldRustDxe"
# "MsCorePkg/HelloWorldRustDxe"
]

# Add packages that generate libraries here
Expand Down

0 comments on commit 1c35bf1

Please sign in to comment.