Skip to content

Commit fc65f6a

Browse files
committed
Fix import errors for #[cfg(doc)] target
1 parent a817647 commit fc65f6a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,21 @@ use crate::ptr::read_unaligned;
99
use crate::slice::from_raw_parts;
1010
use crate::sys::net::Socket;
1111

12-
#[cfg(any(target_os = "android", target_os = "linux",))]
13-
use libc::{gid_t, pid_t, uid_t};
1412
// FIXME(#43348): Make libc adapt #[doc(cfg(...))] so we don't need these fake definitions here?
1513
#[cfg(not(unix))]
1614
#[allow(non_camel_case_types)]
1715
mod libc {
16+
pub use libc::c_int;
1817
pub struct ucred;
1918
pub struct cmsghdr;
2019
pub type pid_t = i32;
2120
pub type gid_t = u32;
2221
pub type uid_t = u32;
2322
}
2423

24+
#[cfg(any(doc, target_os = "android", target_os = "linux",))]
25+
use libc::{gid_t, pid_t, uid_t};
26+
2527
pub(super) fn recv_vectored_with_ancillary_from(
2628
socket: &Socket,
2729
bufs: &mut [IoSliceMut<'_>],

0 commit comments

Comments
 (0)