diff --git a/litebox/Cargo.toml b/litebox/Cargo.toml index 3e274069c..b7ecc58cf 100644 --- a/litebox/Cargo.toml +++ b/litebox/Cargo.toml @@ -21,7 +21,7 @@ litebox_broker_protocol = { version = "0.1.0", path = "../litebox_broker_protoco litebox_broker_transport = { version = "0.1.0", path = "../litebox_broker_transport" } litebox_platform = { version = "0.1.0", path = "../litebox_platform" } -[target.'cfg(windows)'.dependencies] +[target.'cfg(target_os = "windows")'.dependencies] windows-sys = { version = "0.60.2", features = [ "Win32_Foundation", "Win32_System_Diagnostics_Debug", diff --git a/litebox/src/mm/exception_table.rs b/litebox/src/mm/exception_table.rs index aa7bf081f..df4278764 100644 --- a/litebox/src/mm/exception_table.rs +++ b/litebox/src/mm/exception_table.rs @@ -347,7 +347,7 @@ fn exception_table() -> &'static [ExceptionTableEntry] { /// /// However, Rust/LLVM inline asm (but not global asm) seems to drop the '$', so /// this doesn't work. So, we use a different technique. -#[cfg(windows)] +#[cfg(target_os = "windows")] #[expect(clippy::cast_ptr_alignment)] fn exception_table() -> &'static [ExceptionTableEntry] { use crate::utils::ReinterpretUnsignedExt as _; diff --git a/litebox_broker_local_userland/Cargo.toml b/litebox_broker_local_userland/Cargo.toml index 5a2254fef..d245e2949 100644 --- a/litebox_broker_local_userland/Cargo.toml +++ b/litebox_broker_local_userland/Cargo.toml @@ -12,7 +12,7 @@ litebox_broker_transport = { path = "../litebox_broker_transport", version = "0. [target.'cfg(target_os = "linux")'.dependencies] litebox_broker_transport_linux_userland = { path = "../litebox_broker_transport_linux_userland", version = "0.1.0" } -[target.'cfg(all(windows, target_arch = "x86_64"))'.dependencies] +[target.'cfg(all(target_os = "windows", target_arch = "x86_64"))'.dependencies] litebox_broker_transport_windows_userland = { path = "../litebox_broker_transport_windows_userland", version = "0.1.0" } [lints] diff --git a/litebox_broker_local_userland/src/lib.rs b/litebox_broker_local_userland/src/lib.rs index 90c69d2bf..e23ffc2e1 100644 --- a/litebox_broker_local_userland/src/lib.rs +++ b/litebox_broker_local_userland/src/lib.rs @@ -3,7 +3,10 @@ //! Hosted userland bindings for the portable broker local endpoint. -#![cfg(any(target_os = "linux", all(windows, target_arch = "x86_64")))] +#![cfg(any( + target_os = "linux", + all(target_os = "windows", target_arch = "x86_64") +))] #[cfg(target_os = "linux")] mod linux; @@ -12,7 +15,7 @@ pub use linux::{ BrokerAssociationFailureCoordinator, BrokerConnection, connect, start_notification_receiver, }; -#[cfg(all(windows, target_arch = "x86_64"))] +#[cfg(all(target_os = "windows", target_arch = "x86_64"))] mod windows; -#[cfg(all(windows, target_arch = "x86_64"))] +#[cfg(all(target_os = "windows", target_arch = "x86_64"))] pub use windows::{BrokerConnection, connect, start_notification_receiver}; diff --git a/litebox_broker_transport_windows_userland/Cargo.toml b/litebox_broker_transport_windows_userland/Cargo.toml index aa419fa1f..c875a4825 100644 --- a/litebox_broker_transport_windows_userland/Cargo.toml +++ b/litebox_broker_transport_windows_userland/Cargo.toml @@ -7,7 +7,7 @@ edition = "2024" litebox_broker_protocol = { path = "../litebox_broker_protocol", version = "0.1.0" } litebox_broker_transport = { path = "../litebox_broker_transport", version = "0.1.0" } -[target.'cfg(windows)'.dependencies] +[target.'cfg(target_os = "windows")'.dependencies] windows-sys = { version = "0.60.2", features = [ "Win32_Foundation", "Win32_Security", diff --git a/litebox_broker_transport_windows_userland/src/lib.rs b/litebox_broker_transport_windows_userland/src/lib.rs index 090c597a5..c6700f86d 100644 --- a/litebox_broker_transport_windows_userland/src/lib.rs +++ b/litebox_broker_transport_windows_userland/src/lib.rs @@ -6,7 +6,7 @@ //! Portable protocol and control-ring state live in `litebox_broker_transport`. //! This crate supplies Windows file-mapping and IPC bindings for hosted deployments. -#![cfg(all(windows, target_arch = "x86_64"))] +#![cfg(all(target_os = "windows", target_arch = "x86_64"))] pub mod control_ring; mod host; diff --git a/litebox_broker_userland/Cargo.toml b/litebox_broker_userland/Cargo.toml index 07626a2e8..7123e9f90 100644 --- a/litebox_broker_userland/Cargo.toml +++ b/litebox_broker_userland/Cargo.toml @@ -17,7 +17,7 @@ litebox_broker_platform_linux_userland = { path = "../litebox_broker_platform_li litebox_broker_transport_linux_userland = { path = "../litebox_broker_transport_linux_userland", version = "0.1.0" } tempfile = { version = "3", default-features = false } -[target.'cfg(all(windows, target_arch = "x86_64"))'.dependencies] +[target.'cfg(all(target_os = "windows", target_arch = "x86_64"))'.dependencies] litebox_broker_transport_windows_userland = { path = "../litebox_broker_transport_windows_userland", version = "0.1.0" } [features] diff --git a/litebox_broker_userland/src/main.rs b/litebox_broker_userland/src/main.rs index d96b878f7..f11549f14 100644 --- a/litebox_broker_userland/src/main.rs +++ b/litebox_broker_userland/src/main.rs @@ -19,7 +19,7 @@ use litebox_broker_protocol::socket::{Ipv4Address, Port}; #[cfg(target_os = "linux")] mod linux; -#[cfg(all(windows, target_arch = "x86_64"))] +#[cfg(all(target_os = "windows", target_arch = "x86_64"))] mod windows; const SETUP_TIMEOUT: Duration = Duration::from_secs(5); @@ -185,12 +185,15 @@ fn main() -> Result<(), Box> { linux::run(CliArgs::parse()) } -#[cfg(all(windows, target_arch = "x86_64"))] +#[cfg(all(target_os = "windows", target_arch = "x86_64"))] fn main() -> Result<(), Box> { windows::run(CliArgs::parse()) } -#[cfg(not(any(target_os = "linux", all(windows, target_arch = "x86_64"))))] +#[cfg(not(any( + target_os = "linux", + all(target_os = "windows", target_arch = "x86_64") +)))] fn main() {} #[cfg(test)] diff --git a/litebox_platform_windows_userland/Cargo.toml b/litebox_platform_windows_userland/Cargo.toml index d58191b45..4bb81a99b 100644 --- a/litebox_platform_windows_userland/Cargo.toml +++ b/litebox_platform_windows_userland/Cargo.toml @@ -3,7 +3,7 @@ name = "litebox_platform_windows_userland" version = "0.1.0" edition = "2024" -[target.'cfg(windows)'.dependencies] +[target.'cfg(target_os = "windows")'.dependencies] litebox = { path = "../litebox/", version = "0.1.0" } litebox_common_linux = { path = "../litebox_common_linux", version = "0.1.0" } litebox_platform = { path = "../litebox_platform", version = "0.1.0" } diff --git a/litebox_syscall_rewriter/src/main.rs b/litebox_syscall_rewriter/src/main.rs index fa0089bd4..a1954e672 100644 --- a/litebox_syscall_rewriter/src/main.rs +++ b/litebox_syscall_rewriter/src/main.rs @@ -59,7 +59,7 @@ fn copy_file_permissions( input_file.metadata()?.mode(), ))?; } - #[cfg(windows)] + #[cfg(target_os = "windows")] { let input_metadata = input_file.metadata()?; let perms = input_metadata.permissions();