More test fixes and rebase conflicts
This commit is contained in:
parent
adcda46011
commit
d2f990f2b0
@ -41,7 +41,6 @@ use cmp::Ordering::{Less, Equal, Greater};
|
||||
use cmp;
|
||||
use default::Default;
|
||||
use iter::*;
|
||||
use num::Int;
|
||||
use ops::{FnMut, self, Index};
|
||||
use ops::RangeFull;
|
||||
use option::Option;
|
||||
|
@ -140,6 +140,7 @@ pub const INIT: StaticKey = StaticKey {
|
||||
/// Constant initialization value for the inner part of static TLS keys.
|
||||
///
|
||||
/// This value allows specific configuration of the destructor for a TLS key.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub const INIT_INNER: StaticKeyInner = StaticKeyInner {
|
||||
key: atomic::ATOMIC_USIZE_INIT,
|
||||
};
|
||||
|
@ -19,7 +19,9 @@ pub use self::FILE_INFO_BY_HANDLE_CLASS::*;
|
||||
pub use libc::consts::os::extra::{
|
||||
FILE_ATTRIBUTE_READONLY,
|
||||
FILE_ATTRIBUTE_DIRECTORY,
|
||||
WSAPROTOCOL_LEN,
|
||||
};
|
||||
pub use libc::types::os::arch::extra::{GROUP, GUID, WSAPROTOCOLCHAIN};
|
||||
|
||||
pub const WSADESCRIPTION_LEN: usize = 256;
|
||||
pub const WSASYS_STATUS_LEN: usize = 128;
|
||||
@ -41,6 +43,7 @@ pub const WSA_INFINITE: libc::DWORD = libc::INFINITE;
|
||||
pub const WSA_WAIT_TIMEOUT: libc::DWORD = libc::consts::os::extra::WAIT_TIMEOUT;
|
||||
pub const WSA_WAIT_EVENT_0: libc::DWORD = libc::consts::os::extra::WAIT_OBJECT_0;
|
||||
pub const WSA_WAIT_FAILED: libc::DWORD = libc::consts::os::extra::WAIT_FAILED;
|
||||
pub const WSAESHUTDOWN: libc::c_int = 10058;
|
||||
|
||||
pub const ERROR_NO_MORE_FILES: libc::DWORD = 18;
|
||||
pub const TOKEN_READ: libc::DWORD = 0x20008;
|
||||
@ -80,6 +83,33 @@ pub type LPWSANETWORKEVENTS = *mut WSANETWORKEVENTS;
|
||||
|
||||
pub type WSAEVENT = libc::HANDLE;
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy)]
|
||||
pub struct WSAPROTOCOL_INFO {
|
||||
pub dwServiceFlags1: libc::DWORD,
|
||||
pub dwServiceFlags2: libc::DWORD,
|
||||
pub dwServiceFlags3: libc::DWORD,
|
||||
pub dwServiceFlags4: libc::DWORD,
|
||||
pub dwProviderFlags: libc::DWORD,
|
||||
pub ProviderId: GUID,
|
||||
pub dwCatalogEntryId: libc::DWORD,
|
||||
pub ProtocolChain: WSAPROTOCOLCHAIN,
|
||||
pub iVersion: libc::c_int,
|
||||
pub iAddressFamily: libc::c_int,
|
||||
pub iMaxSockAddr: libc::c_int,
|
||||
pub iMinSockAddr: libc::c_int,
|
||||
pub iSocketType: libc::c_int,
|
||||
pub iProtocol: libc::c_int,
|
||||
pub iProtocolMaxOffset: libc::c_int,
|
||||
pub iNetworkByteOrder: libc::c_int,
|
||||
pub iSecurityScheme: libc::c_int,
|
||||
pub dwMessageSize: libc::DWORD,
|
||||
pub dwProviderReserved: libc::DWORD,
|
||||
pub szProtocol: [u16; (WSAPROTOCOL_LEN as usize) + 1us],
|
||||
}
|
||||
|
||||
pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct fd_set {
|
||||
fd_count: libc::c_uint,
|
||||
@ -184,6 +214,7 @@ pub struct FILE_END_OF_FILE_INFO {
|
||||
extern "system" {
|
||||
pub fn WSAStartup(wVersionRequested: libc::WORD,
|
||||
lpWSAData: LPWSADATA) -> libc::c_int;
|
||||
pub fn WSACleanup() -> libc::c_int;
|
||||
pub fn WSAGetLastError() -> libc::c_int;
|
||||
pub fn WSACloseEvent(hEvent: WSAEVENT) -> libc::BOOL;
|
||||
pub fn WSACreateEvent() -> WSAEVENT;
|
||||
@ -200,6 +231,17 @@ extern "system" {
|
||||
hEventObject: WSAEVENT,
|
||||
lpNetworkEvents: LPWSANETWORKEVENTS)
|
||||
-> libc::c_int;
|
||||
pub fn WSADuplicateSocketW(s: libc::SOCKET,
|
||||
dwProcessId: libc::DWORD,
|
||||
lpProtocolInfo: LPWSAPROTOCOL_INFO)
|
||||
-> libc::c_int;
|
||||
pub fn GetCurrentProcessId() -> libc::DWORD;
|
||||
pub fn WSASocketW(af: libc::c_int,
|
||||
kind: libc::c_int,
|
||||
protocol: libc::c_int,
|
||||
lpProtocolInfo: LPWSAPROTOCOL_INFO,
|
||||
g: GROUP,
|
||||
dwFlags: libc::DWORD) -> libc::SOCKET;
|
||||
|
||||
pub fn ioctlsocket(s: libc::SOCKET, cmd: libc::c_long,
|
||||
argp: *mut libc::c_ulong) -> libc::c_int;
|
||||
|
@ -62,7 +62,7 @@ pub fn cvt_r<T: SignedInt, F>(mut f: F) -> io::Result<T> where F: FnMut() -> T {
|
||||
|
||||
impl Socket {
|
||||
pub fn new(addr: &SocketAddr, ty: c_int) -> io::Result<Socket> {
|
||||
let fam = match addr.ip {
|
||||
let fam = match addr.ip() {
|
||||
IpAddr::V4(..) => libc::AF_INET,
|
||||
IpAddr::V6(..) => libc::AF_INET6,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user