From 370db2f2c4406f3373be9065cda8fcdb3929b693 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 4 Jun 2026 19:27:34 +0200 Subject: refactor(engine): remove cfg aliases --- engine/src/windowing.rs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'engine/src/windowing.rs') diff --git a/engine/src/windowing.rs b/engine/src/windowing.rs index bf29453..3163869 100644 --- a/engine/src/windowing.rs +++ b/engine/src/windowing.rs @@ -499,20 +499,21 @@ fn create_event_loop() -> Result, EventLoopError> { let mut event_loop_builder = EventLoop::builder(); - #[cfg(any(x11_platform, wayland_platform))] - winit::platform::x11::EventLoopBuilderExtX11::with_any_thread( - &mut event_loop_builder, - true, - ); - - #[cfg(windows)] - winit::platform::windows::EventLoopBuilderExtWindows::with_any_thread( - &mut event_loop_builder, - true, - ); - - #[cfg(not(any(x11_platform, wayland_platform, windows)))] - compile_error!("Unsupported platform"); + cfg_select! { + target_os = "linux" => { + winit::platform::x11::EventLoopBuilderExtX11::with_any_thread( + &mut event_loop_builder, + true, + ); + } + windows => { + winit::platform::windows::EventLoopBuilderExtWindows::with_any_thread( + &mut event_loop_builder, + true, + ); + } + _ => { compile_error!("Unsupported platform") } + } event_loop_builder.build() } -- cgit v1.2.3-18-g5258