Skip to content

Commit c030f43

Browse files
committed
fix(support_rza1): fix build failure when doing native build
It should compile successfully even on an unsupported target so that `cargo test --workspace` is useful.
1 parent 1626854 commit c030f43

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/constance_support_rza1/src/stdout.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ where
5656
}
5757

5858
#[inline]
59+
#[cfg(target_arch = "arm")]
5960
fn interrupt_free<T>(x: impl FnOnce() -> T) -> T {
6061
let cpsr: u32;
6162
unsafe { asm!("mrs {}, cpsr", out(reg)cpsr) };
@@ -72,6 +73,11 @@ fn interrupt_free<T>(x: impl FnOnce() -> T) -> T {
7273
ret
7374
}
7475

76+
#[cfg(not(target_arch = "arm"))]
77+
fn interrupt_free<T>(_: impl FnOnce() -> T) -> T {
78+
panic!("this crate is not supported on this platform")
79+
}
80+
7581
#[doc(hidden)]
7682
pub fn write_str(s: &str) {
7783
interrupt_free(|| unsafe {

0 commit comments

Comments
 (0)