Skip to content

Commit 43975ec

Browse files
committed
Minor code simplification using cfg_attr.
1 parent a289605 commit 43975ec

File tree

1 file changed

+10
-32
lines changed
  • src/imp/linux_raw/arch/inline

1 file changed

+10
-32
lines changed

src/imp/linux_raw/arch/inline/mod.rs

+10-32
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,14 @@
22
//! much like regular calls, with custom calling conventions, and calling
33
//! conventions are otherwise the compiler's job. But for now, use inline asm.
44
5-
#[cfg(target_arch = "aarch64")]
6-
mod aarch64;
7-
#[cfg(target_arch = "arm")]
8-
mod arm;
9-
#[cfg(target_arch = "mips")]
10-
mod mips;
11-
#[cfg(target_arch = "mips64")]
12-
mod mips64;
13-
#[cfg(target_arch = "powerpc64")]
14-
mod powerpc64;
15-
#[cfg(target_arch = "riscv64")]
16-
mod riscv64;
17-
#[cfg(target_arch = "x86")]
18-
mod x86;
19-
#[cfg(target_arch = "x86_64")]
20-
mod x86_64;
5+
#[cfg_attr(target_arch = "aarch64", path = "aarch64.rs")]
6+
#[cfg_attr(target_arch = "arm", path = "arm.rs")]
7+
#[cfg_attr(target_arch = "mips", path = "mips.rs")]
8+
#[cfg_attr(target_arch = "mips64", path = "mips64.rs")]
9+
#[cfg_attr(target_arch = "powerpc64", path = "powerpc64.rs")]
10+
#[cfg_attr(target_arch = "riscv64", path = "riscv64.rs")]
11+
#[cfg_attr(target_arch = "x86", path = "x86.rs")]
12+
#[cfg_attr(target_arch = "x86_64", path = "x86_64.rs")]
13+
mod target_arch;
2114

22-
#[cfg(target_arch = "aarch64")]
23-
pub(in crate::imp) use self::aarch64::*;
24-
#[cfg(target_arch = "arm")]
25-
pub(in crate::imp) use self::arm::*;
26-
#[cfg(target_arch = "mips")]
27-
pub(in crate::imp) use self::mips::*;
28-
#[cfg(target_arch = "mips64")]
29-
pub(in crate::imp) use self::mips64::*;
30-
#[cfg(target_arch = "powerpc64")]
31-
pub(in crate::imp) use self::powerpc64::*;
32-
#[cfg(target_arch = "riscv64")]
33-
pub(in crate::imp) use self::riscv64::*;
34-
#[cfg(target_arch = "x86")]
35-
pub(in crate::imp) use self::x86::*;
36-
#[cfg(target_arch = "x86_64")]
37-
pub(in crate::imp) use self::x86_64::*;
15+
pub(in crate::imp) use self::target_arch::*;

0 commit comments

Comments
 (0)