From 6348516f8c112c53016005b933a20fea153f7a5f Mon Sep 17 00:00:00 2001 From: Erin Date: Thu, 9 May 2024 11:58:04 +0200 Subject: [PATCH] soft-float --- hbvm/Cargo.toml | 7 ++++--- hbvm/src/float/mod.rs | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hbvm/Cargo.toml b/hbvm/Cargo.toml index 447ddf2..44ccbdf 100644 --- a/hbvm/Cargo.toml +++ b/hbvm/Cargo.toml @@ -4,9 +4,10 @@ version = "0.1.0" edition = "2021" [features] -default = ["alloc"] -alloc = [] -nightly = [] +default = ["alloc", "soft-float"] +alloc = [] +nightly = [] +soft-float = [] [dependencies] hbbytecode = { path = "../hbbytecode" } diff --git a/hbvm/src/float/mod.rs b/hbvm/src/float/mod.rs index 5206f70..274e6ff 100644 --- a/hbvm/src/float/mod.rs +++ b/hbvm/src/float/mod.rs @@ -3,23 +3,23 @@ macro_rules! arch_specific { $({$($cfg:tt)*} : $mod:ident;)* } => { $( - #[cfg($($cfg)*)] + #[cfg(all(not(feature = "soft-float"), $($cfg)*))] mod $mod; - #[cfg($($cfg)*)] + #[cfg(all(not(feature = "soft-float"), $($cfg)*))] pub use $mod::*; - #[cfg($($cfg)*)] + #[cfg(all(not(feature = "soft-float"), $($cfg)*))] pub const FL_ARCH_SPECIFIC_SUPPORTED: bool = true; )* - #[cfg(not(any($($($cfg)*),*)))] + #[cfg(any(feature = "soft-float", not(any($($($cfg)*),*))))] mod unsupported; - #[cfg(not(any($($($cfg)*),*)))] + #[cfg(any(feature = "soft-float", not(any($($($cfg)*),*))))] pub use unsupported::*; - #[cfg(not(any($($($cfg)*),*)))] + #[cfg(any(feature = "soft-float", not(any($($($cfg)*),*))))] pub const FL_ARCH_SPECIFIC_SUPPORTED: bool = false; }; }