Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix compilation errors on macOS and Windows
  • Loading branch information
fanninpm committed Jul 4, 2022
commit 4e87250ba253859a3885a9a8eb075f20c9f941e4
17 changes: 15 additions & 2 deletions stdlib/src/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ mod _socket {
pub use winapi::shared::netioapi::{if_indextoname, if_nametoindex};
pub use winapi::shared::ws2def::*;
pub use winapi::shared::ws2ipdef::*;
pub use winapi::shared::ws2tcpip::*;
pub use winapi::um::winsock2::{
SD_BOTH as SHUT_RDWR, SD_RECEIVE as SHUT_RD, SD_SEND as SHUT_WR, SOCK_DGRAM, SOCK_RAW,
SOCK_RDM, SOCK_SEQPACKET, SOCK_STREAM, SOL_SOCKET, SO_BROADCAST, SO_ERROR, SO_LINGER,
SO_OOBINLINE, SO_REUSEADDR, SO_TYPE, *,
};
pub use winapi::um::ws2tcpip::*;
}
// constants
#[pyattr(name = "has_ipv6")]
Expand Down Expand Up @@ -529,6 +529,19 @@ mod _socket {
#[pyattr]
use c::{TCP_KEEPCNT, TCP_KEEPINTVL};

#[cfg(any(
target_os = "android",
target_os = "dragonfly",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "linux",
target_os = "netbsd",
target_os = "openbsd",
target_os = "redox"
))]
#[pyattr]
use c::{SOCK_CLOEXEC, SOCK_NONBLOCK};

#[cfg(any(
target_os = "android",
target_os = "dragonfly",
Expand All @@ -542,7 +555,7 @@ mod _socket {
#[pyattr]
use c::{
AF_ROUTE, AF_SNA, EAI_OVERFLOW, IPPROTO_GRE, IPPROTO_RSVP, IPPROTO_TP, IPV6_RECVPKTINFO,
MSG_DONTWAIT, SCM_RIGHTS, SOCK_CLOEXEC, SOCK_NONBLOCK, TCP_MAXSEG,
MSG_DONTWAIT, SCM_RIGHTS, TCP_MAXSEG,
};

#[cfg(any(
Expand Down