From 6f41da2385fcb25decba64385a5596cceaae70d0 Mon Sep 17 00:00:00 2001 From: notafet Date: Tue, 10 Mar 2026 10:46:06 -0700 Subject: [PATCH] Relax platform checks --- server-cli/src/main.rs | 4 ++-- server-cli/src/settings.rs | 4 ++-- voxygen/src/main.rs | 2 +- voxygen/src/window.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server-cli/src/main.rs b/server-cli/src/main.rs index f71052847c..e12d712fd1 100644 --- a/server-cli/src/main.rs +++ b/server-cli/src/main.rs @@ -74,14 +74,14 @@ fn main() -> io::Result<()> { // Load settings let settings = settings::Settings::load().ok_or(io::ErrorKind::Other)?; - #[cfg(any(target_os = "linux", target_os = "macos"))] + #[cfg(not(target_os = "windows"))] { for signal in &settings.shutdown_signals { let _ = signal_hook::flag::register(signal.to_signal(), Arc::clone(&shutdown_signal)); } } - #[cfg(not(any(target_os = "linux", target_os = "macos")))] + #[cfg(target_os = "windows")] if !settings.shutdown_signals.is_empty() { tracing::warn!( "Server configuration contains shutdown signals, but your platform does not support \ diff --git a/server-cli/src/settings.rs b/server-cli/src/settings.rs index 09f87b34e5..6fc1e30e69 100644 --- a/server-cli/src/settings.rs +++ b/server-cli/src/settings.rs @@ -15,7 +15,7 @@ pub enum ShutdownSignal { } impl ShutdownSignal { - #[cfg(any(target_os = "linux", target_os = "macos"))] + #[cfg(not(target_os = "windows"))] pub fn to_signal(self) -> core::ffi::c_int { match self { Self::SIGUSR1 => signal_hook::consts::SIGUSR1, @@ -48,7 +48,7 @@ impl Default for Settings { web_address: SocketAddr::from((Ipv4Addr::LOCALHOST, 14005)), web_chat_secret: None, ui_api_secret: None, - shutdown_signals: if cfg!(any(target_os = "linux", target_os = "macos")) { + shutdown_signals: if cfg!(not(target_os = "windows")) { vec![ShutdownSignal::SIGUSR1] } else { Vec::new() diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index 17cef14940..21f8d04317 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -47,7 +47,7 @@ fn main() { cli::Commands::ListWgpuBackends => { #[cfg(target_os = "windows")] let backends = &["opengl", "dx12", "vulkan"]; - #[cfg(target_os = "linux")] + #[cfg(not(any(target_os = "windows", target_os = "macos")))] let backends = &["opengl", "vulkan"]; #[cfg(target_os = "macos")] let backends = &["metal"]; diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index 63e77393d7..e95cac3f01 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -250,7 +250,7 @@ impl Window { )) .with_maximized(window.maximised); - #[cfg(target_os = "linux")] + #[cfg(not(any(target_os = "windows", target_os = "macos")))] { use winit::platform::wayland::WindowAttributesExtWayland; attributes = attributes.with_name("net.veloren.veloren", "veloren");