Skip to content

Commit f5cb0b1

Browse files
taiki-eThomasdezeeuw
authored andcommitted
Update windows-sys to 0.48
1 parent 4c55898 commit f5cb0b1

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ features = ["all"]
3838
libc = "0.2.139"
3939

4040
[target.'cfg(windows)'.dependencies.windows-sys]
41-
version = "0.45"
41+
version = "0.48"
4242
features = [
4343
"Win32_Foundation",
4444
"Win32_Networking_WinSock",
4545
"Win32_System_IO",
46+
"Win32_System_Threading",
4647
"Win32_System_WindowsProgramming",
4748
]
4849

src/sys/windows.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use windows_sys::Win32::Networking::WinSock::{
2626
SOCKET_ERROR, WSABUF, WSAEMSGSIZE, WSAESHUTDOWN, WSAPOLLFD, WSAPROTOCOL_INFOW,
2727
WSA_FLAG_NO_HANDLE_INHERIT, WSA_FLAG_OVERLAPPED,
2828
};
29-
use windows_sys::Win32::System::WindowsProgramming::INFINITE;
29+
use windows_sys::Win32::System::Threading::INFINITE;
3030

3131
use crate::{RecvFlags, SockAddr, TcpKeepalive, Type};
3232

@@ -638,7 +638,7 @@ pub(crate) fn send_to_vectored(
638638
}
639639

640640
/// Wrapper around `getsockopt` to deal with platform specific timeouts.
641-
pub(crate) fn timeout_opt(fd: Socket, lvl: c_int, name: u32) -> io::Result<Option<Duration>> {
641+
pub(crate) fn timeout_opt(fd: Socket, lvl: c_int, name: i32) -> io::Result<Option<Duration>> {
642642
unsafe { getsockopt(fd, lvl, name).map(from_ms) }
643643
}
644644

@@ -656,7 +656,7 @@ fn from_ms(duration: u32) -> Option<Duration> {
656656
pub(crate) fn set_timeout_opt(
657657
socket: Socket,
658658
level: c_int,
659-
optname: u32,
659+
optname: i32,
660660
duration: Option<Duration>,
661661
) -> io::Result<()> {
662662
let duration = into_ms(duration);
@@ -703,14 +703,14 @@ pub(crate) fn set_tcp_keepalive(socket: Socket, keepalive: &TcpKeepalive) -> io:
703703

704704
/// Caller must ensure `T` is the correct type for `level` and `optname`.
705705
// NOTE: `optname` is actually `i32`, but all constants are `u32`.
706-
pub(crate) unsafe fn getsockopt<T>(socket: Socket, level: c_int, optname: u32) -> io::Result<T> {
706+
pub(crate) unsafe fn getsockopt<T>(socket: Socket, level: c_int, optname: i32) -> io::Result<T> {
707707
let mut optval: MaybeUninit<T> = MaybeUninit::uninit();
708708
let mut optlen = mem::size_of::<T>() as c_int;
709709
syscall!(
710710
getsockopt(
711711
socket,
712712
level as i32,
713-
optname as i32,
713+
optname,
714714
optval.as_mut_ptr().cast(),
715715
&mut optlen,
716716
),
@@ -729,14 +729,14 @@ pub(crate) unsafe fn getsockopt<T>(socket: Socket, level: c_int, optname: u32) -
729729
pub(crate) unsafe fn setsockopt<T>(
730730
socket: Socket,
731731
level: c_int,
732-
optname: u32,
732+
optname: i32,
733733
optval: T,
734734
) -> io::Result<()> {
735735
syscall!(
736736
setsockopt(
737737
socket,
738738
level as i32,
739-
optname as i32,
739+
optname,
740740
(&optval as *const T).cast(),
741741
mem::size_of::<T>() as c_int,
742742
),

0 commit comments

Comments
 (0)