mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
fix: guard macos-ne feature with target_os = "macos" in cfg expressions (#1962)
All 13 occurrences of `any(target_os = "ios", feature = "macos-ne")` are replaced with `any(target_os = "ios", all(target_os = "macos", feature = "macos-ne"))`. Previously, enabling `macos-ne` on non-macOS platforms (e.g. `--all-features` on Linux) would incorrectly compile macOS/mobile-specific code paths, causing build failures or wrong runtime behavior. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -115,7 +115,10 @@ impl IpProxy {
|
||||
tracing::error!("start icmp proxy failed: {:?}", e);
|
||||
if cfg!(not(any(
|
||||
target_os = "android",
|
||||
any(target_os = "ios", feature = "macos-ne"),
|
||||
any(
|
||||
target_os = "ios",
|
||||
all(target_os = "macos", feature = "macos-ne")
|
||||
),
|
||||
target_env = "ohos"
|
||||
))) {
|
||||
// android, ios and ohos not support icmp proxy
|
||||
@@ -805,7 +808,7 @@ impl Instance {
|
||||
#[cfg(all(
|
||||
not(any(
|
||||
target_os = "android",
|
||||
any(target_os = "ios", feature = "macos-ne"),
|
||||
any(target_os = "ios", all(target_os = "macos", feature = "macos-ne")),
|
||||
target_env = "ohos"
|
||||
)),
|
||||
feature = "tun"
|
||||
@@ -853,7 +856,7 @@ impl Instance {
|
||||
#[cfg(all(
|
||||
not(any(
|
||||
target_os = "android",
|
||||
any(target_os = "ios", feature = "macos-ne"),
|
||||
any(target_os = "ios", all(target_os = "macos", feature = "macos-ne")),
|
||||
target_env = "ohos"
|
||||
)),
|
||||
feature = "tun"
|
||||
@@ -947,7 +950,7 @@ impl Instance {
|
||||
|
||||
#[cfg(not(any(
|
||||
target_os = "android",
|
||||
any(target_os = "ios", feature = "macos-ne"),
|
||||
any(target_os = "ios", all(target_os = "macos", feature = "macos-ne")),
|
||||
target_env = "ohos"
|
||||
)))]
|
||||
if !self.global_ctx.config.get_flags().no_tun {
|
||||
@@ -1463,7 +1466,7 @@ impl Instance {
|
||||
|
||||
#[cfg(any(
|
||||
target_os = "android",
|
||||
any(target_os = "ios", feature = "macos-ne"),
|
||||
any(target_os = "ios", all(target_os = "macos", feature = "macos-ne")),
|
||||
target_env = "ohos"
|
||||
))]
|
||||
pub async fn setup_nic_ctx_for_mobile(
|
||||
|
||||
Reference in New Issue
Block a user