// 只在 Windows 编译这个函数 #[cfg(target_os = "windows")] fn only_windows() {} // 组合条件:any / all / not #[cfg(any(target_os = "linux", target_os = "macos"))] fn unix_style() {} #[cfg(debug_assertions)] fn debug_build() {}