1
Fork 0

Move conditional compilation to the upper module and sort the target OS list alphabetically

This commit is contained in:
LinkTed 2020-08-28 18:41:48 +02:00
parent 07ed6afc6d
commit 53791b3ff4
4 changed files with 199 additions and 189 deletions

View file

@ -16,6 +16,22 @@ use crate::path::Path;
use crate::sys::cvt;
use crate::sys::net::Socket;
use crate::sys::unix::ext::net::addr::{sockaddr_un, SocketAddr};
#[cfg(any(
target_os = "android",
target_os = "dragonfly",
target_os = "emscripten",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "haiku",
target_os = "illumos",
target_os = "ios",
target_os = "linux",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "solaris",
target_env = "uclibc",
))]
use crate::sys::unix::ext::net::ancillary::{
recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to, SocketAncillary,
};
@ -458,6 +474,22 @@ impl UnixStream {
/// Ok(())
/// }
/// ```
#[cfg(any(
target_os = "android",
target_os = "dragonfly",
target_os = "emscripten",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "haiku",
target_os = "illumos",
target_os = "ios",
target_os = "linux",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "solaris",
target_env = "uclibc",
))]
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
pub fn recv_vectored_with_ancillary(
&self,
@ -498,6 +530,22 @@ impl UnixStream {
/// Ok(())
/// }
/// ```
#[cfg(any(
target_os = "android",
target_os = "dragonfly",
target_os = "emscripten",
target_os = "freebsd",
target_os = "fuchsia",
target_os = "haiku",
target_os = "illumos",
target_os = "ios",
target_os = "linux",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd",
target_os = "solaris",
target_env = "uclibc",
))]
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
pub fn send_vectored_with_ancillary(
&self,