From 2a3b0a34369b2a9965f0953df60ec06fafd811e2 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Thu, 25 Jul 2024 20:44:52 +0700 Subject: [PATCH] example: Fix wrong `target_os` check. (#36) Bring over the new version of this function from `vello`. --- examples/with_winit/src/lib.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/with_winit/src/lib.rs b/examples/with_winit/src/lib.rs index 7e8ff1c..07eace4 100644 --- a/examples/with_winit/src/lib.rs +++ b/examples/with_winit/src/lib.rs @@ -44,12 +44,10 @@ struct Args { } fn default_threads() -> usize { - #![allow(unreachable_code)] - #[cfg(target_os = "mac")] - { - return 1; - } - 0 + #[cfg(target_os = "macos")] + return 1; + #[cfg(not(target_os = "macos"))] + return 0; } struct RenderState<'s> {