From 67882aa307961b6eff95db1b874914475b7a6365 Mon Sep 17 00:00:00 2001 From: Oscar Beaumont Date: Mon, 21 Jul 2025 18:28:02 +0800 Subject: [PATCH] ios support --- Cargo.toml | 2 +- src/interface/mod.rs | 2 +- src/interface/unix.rs | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5ad71d3..4e1ce96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ features = [ "Win32_NetworkManagement_Ndis", ] -[target.'cfg(target_vendor = "apple")'.dependencies] +[target.'cfg(target_os = "macos")'.dependencies] system-configuration = "0.6" [dev-dependencies] diff --git a/src/interface/mod.rs b/src/interface/mod.rs index 1837356..eca5a44 100644 --- a/src/interface/mod.rs +++ b/src/interface/mod.rs @@ -39,7 +39,7 @@ mod linux; #[cfg(target_os = "android")] mod android; -#[cfg(target_vendor = "apple")] +#[cfg(target_os = "macos")] mod macos; #[cfg(feature = "gateway")] use crate::device::NetworkDevice; diff --git a/src/interface/unix.rs b/src/interface/unix.rs index f80b31b..ac55dfe 100644 --- a/src/interface/unix.rs +++ b/src/interface/unix.rs @@ -47,7 +47,7 @@ pub fn get_system_dns_conf() -> Vec { } } -#[cfg(target_vendor = "apple")] +#[cfg(all(target_vendor = "apple", target_os = "macos"))] pub fn interfaces() -> Vec { use super::macos; @@ -92,6 +92,11 @@ pub fn interfaces() -> Vec { interfaces } +#[cfg(all(target_vendor = "apple", not(target_os = "macos")))] +pub fn interfaces() -> Vec { + unix_interfaces() +} + #[cfg(any(target_os = "linux", target_os = "android"))] pub fn interfaces() -> Vec { #[cfg(feature = "gateway")]