From fe141d98c26ed4aad54cf98896029ea0a0623587 Mon Sep 17 00:00:00 2001 From: xkeyC <3334969096@qq.com> Date: Fri, 5 Dec 2025 11:29:35 +0800 Subject: [PATCH] fix: macos build --- rust/src/api/win32_api.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rust/src/api/win32_api.rs b/rust/src/api/win32_api.rs index 09c4b3e..744ba81 100644 --- a/rust/src/api/win32_api.rs +++ b/rust/src/api/win32_api.rs @@ -351,7 +351,7 @@ pub fn resolve_shortcut(lnk_path: &str) -> anyhow::Result { } #[cfg(not(target_os = "windows"))] -pub fn resolve_shortcut(lnk_path: &str) -> anyhow::Result { +pub fn resolve_shortcut(_: &str) -> anyhow::Result { Ok(String::new()) } @@ -756,8 +756,9 @@ pub fn start_process(program: &str, args: Vec) -> anyhow::Result<()> { } // ============== NVME Patch Functions ============== - +#[cfg(target_os = "windows")] const NVME_REGISTRY_PATH: &str = r"SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device"; +#[cfg(target_os = "windows")] const NVME_VALUE_NAME: &str = "ForcedPhysicalSectorSizeInBytes"; /// Check if NVME patch is applied @@ -915,4 +916,9 @@ pub fn remove_nvme_patch() -> anyhow::Result<()> { Ok(()) } +} + +#[cfg(not(target_os = "windows"))] +pub fn remove_nvme_patch() -> anyhow::Result<()> { + Err(anyhow::anyhow!("NVME patch is only supported on Windows")) } \ No newline at end of file