Skip to content

Commit a817647

Browse files
committed
Add fake definitions for Windows
1 parent d0069a0 commit a817647

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

library/std/src/sys/unix/ext/net/ancillary.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ use crate::sys::net::Socket;
1111

1212
#[cfg(any(target_os = "android", target_os = "linux",))]
1313
use libc::{gid_t, pid_t, uid_t};
14+
// FIXME(#43348): Make libc adapt #[doc(cfg(...))] so we don't need these fake definitions here?
15+
#[cfg(not(unix))]
16+
#[allow(non_camel_case_types)]
17+
mod libc {
18+
pub struct ucred;
19+
pub struct cmsghdr;
20+
pub type pid_t = i32;
21+
pub type gid_t = u32;
22+
pub type uid_t = u32;
23+
}
1424

1525
pub(super) fn recv_vectored_with_ancillary_from(
1626
socket: &Socket,

0 commit comments

Comments
 (0)