From 9f4ea792af8f9f0d79c3e03f0502de5c3095ad55 Mon Sep 17 00:00:00 2001 From: dev0 Date: Wed, 30 Oct 2024 18:06:35 +1100 Subject: [PATCH] fix build on other plats --- clash_lib/src/proxy/tun/routes/mod.rs | 2 ++ clash_lib/src/proxy/tun/routes/other.rs | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/clash_lib/src/proxy/tun/routes/mod.rs b/clash_lib/src/proxy/tun/routes/mod.rs index 6ab32c20a..10a15af78 100644 --- a/clash_lib/src/proxy/tun/routes/mod.rs +++ b/clash_lib/src/proxy/tun/routes/mod.rs @@ -23,6 +23,8 @@ pub use linux::maybe_routes_clean_up; mod other; #[cfg(not(any(windows, target_os = "macos", target_os = "linux")))] use other::add_route; +#[cfg(not(any(windows, target_os = "macos", target_os = "linux")))] +pub use other::maybe_routes_clean_up; use tracing::warn; diff --git a/clash_lib/src/proxy/tun/routes/other.rs b/clash_lib/src/proxy/tun/routes/other.rs index 01bda4583..52ada4a57 100644 --- a/clash_lib/src/proxy/tun/routes/other.rs +++ b/clash_lib/src/proxy/tun/routes/other.rs @@ -1,9 +1,17 @@ use ipnet::IpNet; use tracing::warn; -use crate::proxy::utils::OutboundInterface; +use crate::{config::internal::config::TunConfig, proxy::utils::OutboundInterface}; pub fn add_route(_: &OutboundInterface, _: &IpNet) -> std::io::Result<()> { warn!("add_route is not implemented on {}", std::env::consts::OS); Ok(()) } + +pub fn maybe_routes_clean_up(_: &TunConfig) -> std::io::Result<()> { + warn!( + "maybe_routes_clean_up is not implemented on {}", + std::env::consts::OS + ); + Ok(()) +}