Skip to content

Commit

Permalink
Remove wireguard_go cfg variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Serock3 committed Jan 23, 2025
1 parent 74cd9b1 commit b552c26
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
3 changes: 0 additions & 3 deletions talpid-wireguard/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ fn main() {
if target_os == "windows" {
declare_libs_dir("../dist-assets/binaries");
}
// Wireguard-Go can be used on all platforms
println!("cargo::rustc-check-cfg=cfg(wireguard_go)");
println!("cargo::rustc-cfg=wireguard_go");

// Enable DAITA by default on desktop and android
println!("cargo::rustc-check-cfg=cfg(daita)");
Expand Down
6 changes: 1 addition & 5 deletions talpid-wireguard/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ mod ephemeral;
mod logging;
mod obfuscation;
mod stats;
#[cfg(wireguard_go)]
mod wireguard_go;
#[cfg(target_os = "linux")]
pub(crate) mod wireguard_kernel;
Expand All @@ -51,7 +50,6 @@ mod wireguard_nt;
#[cfg(not(target_os = "android"))]
mod mtu_detection;

#[cfg(wireguard_go)]
use self::wireguard_go::WgGoTunnel;

// On android we only have Wireguard Go tunnel
Expand Down Expand Up @@ -668,8 +666,7 @@ impl WireguardMonitor {
) -> Result<TunnelType> {
log::debug!("Tunnel MTU: {}", config.mtu);

let userspace_wireguard =
cfg!(wireguard_go) && (*FORCE_USERSPACE_WIREGUARD || config.daita);
let userspace_wireguard = *FORCE_USERSPACE_WIREGUARD || config.daita;

if userspace_wireguard {
log::debug!("Using userspace WireGuard implementation");
Expand Down Expand Up @@ -754,7 +751,6 @@ impl WireguardMonitor {
}

/// Configure and start a Wireguard-go tunnel.
#[cfg(wireguard_go)]
fn open_wireguard_go_tunnel(
#[cfg(windows)] runtime: tokio::runtime::Handle,
config: &Config,
Expand Down
2 changes: 0 additions & 2 deletions talpid-wireguard/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ pub fn clean_up_logging(ordinal: u64) {
#[allow(dead_code)]
pub enum LogLevel {
Verbose,
#[cfg_attr(wireguard_go, allow(dead_code))]
Info,
#[cfg_attr(wireguard_go, allow(dead_code))]
Warning,
Error,
}
Expand Down

0 comments on commit b552c26

Please sign in to comment.