diff options
Diffstat (limited to 'vendor/rustix/src/backend/libc/net/send_recv.rs')
-rw-r--r-- | vendor/rustix/src/backend/libc/net/send_recv.rs | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/vendor/rustix/src/backend/libc/net/send_recv.rs b/vendor/rustix/src/backend/libc/net/send_recv.rs index 49c6f2c22..e91017e97 100644 --- a/vendor/rustix/src/backend/libc/net/send_recv.rs +++ b/vendor/rustix/src/backend/libc/net/send_recv.rs @@ -1,4 +1,4 @@ -use super::super::c; +use crate::backend::c; use bitflags::bitflags; bitflags! { @@ -6,7 +6,9 @@ bitflags! { /// /// [`send`]: crate::net::send /// [`sendto`]: crate::net::sendto - pub struct SendFlags: i32 { + #[repr(transparent)] + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + pub struct SendFlags: u32 { /// `MSG_CONFIRM` #[cfg(not(any( bsd, @@ -14,15 +16,15 @@ bitflags! { windows, target_os = "haiku", )))] - const CONFIRM = c::MSG_CONFIRM; + const CONFIRM = bitcast!(c::MSG_CONFIRM); /// `MSG_DONTROUTE` - const DONTROUTE = c::MSG_DONTROUTE; + const DONTROUTE = bitcast!(c::MSG_DONTROUTE); /// `MSG_DONTWAIT` #[cfg(not(windows))] - const DONTWAIT = c::MSG_DONTWAIT; + const DONTWAIT = bitcast!(c::MSG_DONTWAIT); /// `MSG_EOR` #[cfg(not(windows))] - const EOT = c::MSG_EOR; + const EOT = bitcast!(c::MSG_EOR); /// `MSG_MORE` #[cfg(not(any( bsd, @@ -30,12 +32,12 @@ bitflags! { windows, target_os = "haiku", )))] - const MORE = c::MSG_MORE; + const MORE = bitcast!(c::MSG_MORE); #[cfg(not(any(apple, windows)))] /// `MSG_NOSIGNAL` - const NOSIGNAL = c::MSG_NOSIGNAL; + const NOSIGNAL = bitcast!(c::MSG_NOSIGNAL); /// `MSG_OOB` - const OOB = c::MSG_OOB; + const OOB = bitcast!(c::MSG_OOB); } } @@ -44,13 +46,15 @@ bitflags! { /// /// [`recv`]: crate::net::recv /// [`recvfrom`]: crate::net::recvfrom - pub struct RecvFlags: i32 { + #[repr(transparent)] + #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] + pub struct RecvFlags: u32 { #[cfg(not(any(apple, solarish, windows, target_os = "haiku")))] /// `MSG_CMSG_CLOEXEC` - const CMSG_CLOEXEC = c::MSG_CMSG_CLOEXEC; + const CMSG_CLOEXEC = bitcast!(c::MSG_CMSG_CLOEXEC); /// `MSG_DONTWAIT` #[cfg(not(windows))] - const DONTWAIT = c::MSG_DONTWAIT; + const DONTWAIT = bitcast!(c::MSG_DONTWAIT); /// `MSG_ERRQUEUE` #[cfg(not(any( bsd, @@ -58,14 +62,14 @@ bitflags! { windows, target_os = "haiku", )))] - const ERRQUEUE = c::MSG_ERRQUEUE; + const ERRQUEUE = bitcast!(c::MSG_ERRQUEUE); /// `MSG_OOB` - const OOB = c::MSG_OOB; + const OOB = bitcast!(c::MSG_OOB); /// `MSG_PEEK` - const PEEK = c::MSG_PEEK; + const PEEK = bitcast!(c::MSG_PEEK); /// `MSG_TRUNC` - const TRUNC = c::MSG_TRUNC as c::c_int; + const TRUNC = bitcast!(c::MSG_TRUNC); /// `MSG_WAITALL` - const WAITALL = c::MSG_WAITALL; + const WAITALL = bitcast!(c::MSG_WAITALL); } } |