std::rt: Fix addrinfo definition on BSD

This commit is contained in:
Brian Anderson 2013-09-05 22:15:02 -07:00
parent 0948f54e65
commit 807408b708

View File

@ -154,7 +154,8 @@ pub type sockaddr_storage = c_void;
pub type socklen_t = c_int;
// XXX: This is a standard C type. Could probably be defined in libc
#[cfg(unix)]
#[cfg(target_os = "android")]
#[cfg(target_os = "linux")]
pub struct addrinfo {
ai_flags: c_int,
ai_family: c_int,
@ -166,6 +167,19 @@ pub struct addrinfo {
ai_next: *addrinfo
}
#[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")]
pub struct addrinfo {
ai_flags: c_int,
ai_family: c_int,
ai_socktype: c_int,
ai_protocol: c_int,
ai_addrlen: socklen_t,
ai_canonname: *char,
ai_addr: *sockaddr,
ai_next: *addrinfo
}
#[cfg(windows)]
pub struct addrinfo {
ai_flags: c_int,