Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions curl-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,6 @@ fn main() {
.file("curl/lib/vauth/vauth.c");
}

if !windows {
cfg.define("USE_UNIX_SOCKETS", None)
.define("HAVE_SYS_UN_H", None);
}

// Configure TLS backend. Since Cargo does not support mutually exclusive
// features, make sure we only compile one vtls.
if cfg!(feature = "mesalink") {
Expand Down Expand Up @@ -288,6 +283,7 @@ fn main() {
}
}

// Configure platform-specific details.
if windows {
cfg.define("WIN32", None)
.define("USE_THREADS_WIN32", None)
Expand All @@ -301,22 +297,14 @@ fn main() {
cfg.file("curl/lib/vauth/spnego_sspi.c");
}
} else {
if target.contains("-apple-") {
cfg.define("__APPLE__", None)
.define("macintosh", None)
.define("HAVE_MACH_ABSOLUTE_TIME", None);
} else {
cfg.define("HAVE_CLOCK_GETTIME_MONOTONIC", None)
.define("HAVE_GETTIMEOFDAY", None);
}

cfg.define("RECV_TYPE_ARG1", "int")
.define("HAVE_PTHREAD_H", None)
.define("HAVE_ARPA_INET_H", None)
.define("HAVE_ERRNO_H", None)
.define("HAVE_FCNTL_H", None)
.define("HAVE_NETDB_H", None)
.define("HAVE_NETINET_IN_H", None)
.define("HAVE_NETINET_TCP_H", None)
.define("HAVE_POLL_FINE", None)
.define("HAVE_POLL_H", None)
.define("HAVE_FCNTL_O_NONBLOCK", None)
Expand All @@ -330,7 +318,9 @@ fn main() {
.define("HAVE_STERRROR_R", None)
.define("HAVE_SOCKETPAIR", None)
.define("HAVE_STRUCT_TIMEVAL", None)
.define("HAVE_SYS_UN_H", None)
.define("USE_THREADS_POSIX", None)
.define("USE_UNIX_SOCKETS", None)
.define("RECV_TYPE_ARG2", "void*")
.define("RECV_TYPE_ARG3", "size_t")
.define("RECV_TYPE_ARG4", "int")
Expand All @@ -345,6 +335,15 @@ fn main() {
.define("SIZEOF_INT", "4")
.define("SIZEOF_SHORT", "2");

if target.contains("-apple-") {
cfg.define("__APPLE__", None)
.define("macintosh", None)
.define("HAVE_MACH_ABSOLUTE_TIME", None);
} else {
cfg.define("HAVE_CLOCK_GETTIME_MONOTONIC", None)
.define("HAVE_GETTIMEOFDAY", None);
}

if cfg!(feature = "spnego") {
cfg.define("HAVE_GSSAPI", None)
.file("curl/lib/curl_gssapi.c")
Expand Down