Skip to content

Commit

Permalink
fix feature gate bug on interrupt macros
Browse files Browse the repository at this point in the history
  • Loading branch information
romancardenas committed Sep 11, 2024
1 parent ce9a296 commit 483a012
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions riscv-rt/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,13 @@ fn trap(
let export_name = format!("{:#}", int_ident);

let start_trap = match arch {
Some(arch) => start_interrupt_trap(int_ident, arch),
Some(arch) => {
let trap = start_interrupt_trap(int_ident, arch);
quote! {
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
#trap
}
}
None => proc_macro2::TokenStream::new(),
};

Expand All @@ -767,7 +773,6 @@ fn trap(
assert_impl(#int_path);
};

#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
#start_trap

#[export_name = #export_name]
Expand Down

0 comments on commit 483a012

Please sign in to comment.