Skip to content

Commit d2f990f

Browse files
committed
More test fixes and rebase conflicts
1 parent adcda46 commit d2f990f

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

src/libcore/slice.rs

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ use cmp::Ordering::{Less, Equal, Greater};
4141
use cmp;
4242
use default::Default;
4343
use iter::*;
44-
use num::Int;
4544
use ops::{FnMut, self, Index};
4645
use ops::RangeFull;
4746
use option::Option;

src/libstd/sys/common/thread_local.rs

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ pub const INIT: StaticKey = StaticKey {
140140
/// Constant initialization value for the inner part of static TLS keys.
141141
///
142142
/// This value allows specific configuration of the destructor for a TLS key.
143+
#[stable(feature = "rust1", since = "1.0.0")]
143144
pub const INIT_INNER: StaticKeyInner = StaticKeyInner {
144145
key: atomic::ATOMIC_USIZE_INIT,
145146
};

src/libstd/sys/windows/c.rs

+42
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ pub use self::FILE_INFO_BY_HANDLE_CLASS::*;
1919
pub use libc::consts::os::extra::{
2020
FILE_ATTRIBUTE_READONLY,
2121
FILE_ATTRIBUTE_DIRECTORY,
22+
WSAPROTOCOL_LEN,
2223
};
24+
pub use libc::types::os::arch::extra::{GROUP, GUID, WSAPROTOCOLCHAIN};
2325

2426
pub const WSADESCRIPTION_LEN: usize = 256;
2527
pub const WSASYS_STATUS_LEN: usize = 128;
@@ -41,6 +43,7 @@ pub const WSA_INFINITE: libc::DWORD = libc::INFINITE;
4143
pub const WSA_WAIT_TIMEOUT: libc::DWORD = libc::consts::os::extra::WAIT_TIMEOUT;
4244
pub const WSA_WAIT_EVENT_0: libc::DWORD = libc::consts::os::extra::WAIT_OBJECT_0;
4345
pub const WSA_WAIT_FAILED: libc::DWORD = libc::consts::os::extra::WAIT_FAILED;
46+
pub const WSAESHUTDOWN: libc::c_int = 10058;
4447

4548
pub const ERROR_NO_MORE_FILES: libc::DWORD = 18;
4649
pub const TOKEN_READ: libc::DWORD = 0x20008;
@@ -80,6 +83,33 @@ pub type LPWSANETWORKEVENTS = *mut WSANETWORKEVENTS;
8083

8184
pub type WSAEVENT = libc::HANDLE;
8285

86+
#[repr(C)]
87+
#[derive(Copy)]
88+
pub struct WSAPROTOCOL_INFO {
89+
pub dwServiceFlags1: libc::DWORD,
90+
pub dwServiceFlags2: libc::DWORD,
91+
pub dwServiceFlags3: libc::DWORD,
92+
pub dwServiceFlags4: libc::DWORD,
93+
pub dwProviderFlags: libc::DWORD,
94+
pub ProviderId: GUID,
95+
pub dwCatalogEntryId: libc::DWORD,
96+
pub ProtocolChain: WSAPROTOCOLCHAIN,
97+
pub iVersion: libc::c_int,
98+
pub iAddressFamily: libc::c_int,
99+
pub iMaxSockAddr: libc::c_int,
100+
pub iMinSockAddr: libc::c_int,
101+
pub iSocketType: libc::c_int,
102+
pub iProtocol: libc::c_int,
103+
pub iProtocolMaxOffset: libc::c_int,
104+
pub iNetworkByteOrder: libc::c_int,
105+
pub iSecurityScheme: libc::c_int,
106+
pub dwMessageSize: libc::DWORD,
107+
pub dwProviderReserved: libc::DWORD,
108+
pub szProtocol: [u16; (WSAPROTOCOL_LEN as usize) + 1us],
109+
}
110+
111+
pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;
112+
83113
#[repr(C)]
84114
pub struct fd_set {
85115
fd_count: libc::c_uint,
@@ -184,6 +214,7 @@ pub struct FILE_END_OF_FILE_INFO {
184214
extern "system" {
185215
pub fn WSAStartup(wVersionRequested: libc::WORD,
186216
lpWSAData: LPWSADATA) -> libc::c_int;
217+
pub fn WSACleanup() -> libc::c_int;
187218
pub fn WSAGetLastError() -> libc::c_int;
188219
pub fn WSACloseEvent(hEvent: WSAEVENT) -> libc::BOOL;
189220
pub fn WSACreateEvent() -> WSAEVENT;
@@ -200,6 +231,17 @@ extern "system" {
200231
hEventObject: WSAEVENT,
201232
lpNetworkEvents: LPWSANETWORKEVENTS)
202233
-> libc::c_int;
234+
pub fn WSADuplicateSocketW(s: libc::SOCKET,
235+
dwProcessId: libc::DWORD,
236+
lpProtocolInfo: LPWSAPROTOCOL_INFO)
237+
-> libc::c_int;
238+
pub fn GetCurrentProcessId() -> libc::DWORD;
239+
pub fn WSASocketW(af: libc::c_int,
240+
kind: libc::c_int,
241+
protocol: libc::c_int,
242+
lpProtocolInfo: LPWSAPROTOCOL_INFO,
243+
g: GROUP,
244+
dwFlags: libc::DWORD) -> libc::SOCKET;
203245

204246
pub fn ioctlsocket(s: libc::SOCKET, cmd: libc::c_long,
205247
argp: *mut libc::c_ulong) -> libc::c_int;

src/libstd/sys/windows/net.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub fn cvt_r<T: SignedInt, F>(mut f: F) -> io::Result<T> where F: FnMut() -> T {
6262

6363
impl Socket {
6464
pub fn new(addr: &SocketAddr, ty: c_int) -> io::Result<Socket> {
65-
let fam = match addr.ip {
65+
let fam = match addr.ip() {
6666
IpAddr::V4(..) => libc::AF_INET,
6767
IpAddr::V6(..) => libc::AF_INET6,
6868
};

0 commit comments

Comments
 (0)