Fix import errors for #[cfg(doc)]
target
This commit is contained in:
parent
a81764731c
commit
fc65f6a0ce
1 changed files with 4 additions and 2 deletions
|
@ -9,12 +9,11 @@ use crate::ptr::read_unaligned;
|
||||||
use crate::slice::from_raw_parts;
|
use crate::slice::from_raw_parts;
|
||||||
use crate::sys::net::Socket;
|
use crate::sys::net::Socket;
|
||||||
|
|
||||||
#[cfg(any(target_os = "android", target_os = "linux",))]
|
|
||||||
use libc::{gid_t, pid_t, uid_t};
|
|
||||||
// FIXME(#43348): Make libc adapt #[doc(cfg(...))] so we don't need these fake definitions here?
|
// FIXME(#43348): Make libc adapt #[doc(cfg(...))] so we don't need these fake definitions here?
|
||||||
#[cfg(not(unix))]
|
#[cfg(not(unix))]
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
mod libc {
|
mod libc {
|
||||||
|
pub use libc::c_int;
|
||||||
pub struct ucred;
|
pub struct ucred;
|
||||||
pub struct cmsghdr;
|
pub struct cmsghdr;
|
||||||
pub type pid_t = i32;
|
pub type pid_t = i32;
|
||||||
|
@ -22,6 +21,9 @@ mod libc {
|
||||||
pub type uid_t = u32;
|
pub type uid_t = u32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(doc, target_os = "android", target_os = "linux",))]
|
||||||
|
use libc::{gid_t, pid_t, uid_t};
|
||||||
|
|
||||||
pub(super) fn recv_vectored_with_ancillary_from(
|
pub(super) fn recv_vectored_with_ancillary_from(
|
||||||
socket: &Socket,
|
socket: &Socket,
|
||||||
bufs: &mut [IoSliceMut<'_>],
|
bufs: &mut [IoSliceMut<'_>],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue