Skip to content

Commit

Permalink
Remove sockaddr_un check
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-airoldie committed Nov 4, 2023
1 parent ec2eb1b commit 0832861
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 45 deletions.
36 changes: 1 addition & 35 deletions src/lib.rs
Expand Up @@ -85,36 +85,6 @@ mod glibc {
}
}

#[cfg(windows)]
mod windows {
use std::{
env,
path::{Path, PathBuf},
};

// Attempt to compile a c program that links to sockaddr_un to determine
// if the OS packages it.
pub(crate) fn has_sockaddr_un() -> bool {
let src =
Path::new(env!("CARGO_MANIFEST_DIR")).join("src/sockaddr_un.c");
println!("cargo:rerun-if-changed={}", src.display());

let dest =
PathBuf::from(env::var("OUT_DIR").unwrap()).join("has_sockaddr_un");

cc::Build::new()
.warnings(false)
.get_compiler()
.to_command()
.arg(src)
.arg("-o")
.arg(dest)
.status()
.expect("failed to execute gcc")
.success()
}
}

/// The location of a library.
#[derive(Debug, Clone)]
pub struct LibLocation {
Expand Down Expand Up @@ -409,11 +379,7 @@ impl Build {
build.define("ZMQ_IOTHREAD_POLLER_USE_EPOLL", "1");
build.define("ZMQ_POLL_BASED_ON_POLL", "1");
build.define("_WIN32_WINNT", "0x0600"); // vista

#[cfg(windows)]
if windows::has_sockaddr_un() {
build.define("ZMQ_HAVE_STRUCT_SOCKADDR_UN", "1");
}
build.define("ZMQ_HAVE_STRUCT_SOCKADDR_UN", "1");

println!("cargo:rustc-link-lib=iphlpapi");

Expand Down
10 changes: 0 additions & 10 deletions src/sockaddr_un.c

This file was deleted.

0 comments on commit 0832861

Please sign in to comment.