#![allow(unused_macros)]
macro_rules! cfg_os_poll {
($($item:item)*) => {
$(
#[cfg(feature = "os-poll")]
#[cfg_attr(docsrs, doc(cfg(feature = "os-poll")))]
$item
)*
}
}
macro_rules! cfg_not_os_poll {
($($item:item)*) => {
$(
#[cfg(not(feature = "os-poll"))]
$item
)*
}
}
macro_rules! cfg_os_ext {
($($item:item)*) => {
$(
#[cfg(feature = "os-ext")]
#[cfg_attr(docsrs, doc(cfg(feature = "os-ext")))]
$item
)*
}
}
macro_rules! cfg_net {
($($item:item)*) => {
$(
#[cfg(feature = "net")]
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
$item
)*
}
}
macro_rules! cfg_io_source {
($($item:item)*) => {
$(
#[cfg(any(feature = "net", all(unix, feature = "os-ext")))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "net", all(unix, feature = "os-ext")))))]
$item
)*
}
}
macro_rules! cfg_any_os_ext {
($($item:item)*) => {
$(
#[cfg(any(feature = "os-ext", feature = "net"))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "os-ext", feature = "net"))))]
$item
)*
}
}
macro_rules! trace {
($($t:tt)*) => {
log!(trace, $($t)*)
}
}
macro_rules! warn {
($($t:tt)*) => {
log!(warn, $($t)*)
}
}
macro_rules! error {
($($t:tt)*) => {
log!(error, $($t)*)
}
}
macro_rules! log {
($level: ident, $($t:tt)*) => {
#[cfg(feature = "log")]
{ log::$level!($($t)*) }
#[cfg(not(feature = "log"))]
{ if false { let _ = ( $($t)* ); } }
}
}