2019-11-18 07:00:55 -08:00
|
|
|
#![allow(unused_macros)]
|
|
|
|
|
|
2020-11-11 09:28:21 -08:00
|
|
|
macro_rules! feature {
|
|
|
|
|
(
|
|
|
|
|
#![$meta:meta]
|
|
|
|
|
$($item:item)*
|
|
|
|
|
) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg($meta)]
|
|
|
|
|
#[cfg_attr(docsrs, doc(cfg($meta)))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-19 09:54:16 +01:00
|
|
|
/// Enables enter::block_on.
|
2020-04-24 06:25:48 -06:00
|
|
|
macro_rules! cfg_block_on {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(any(
|
|
|
|
|
feature = "fs",
|
2020-10-12 16:06:02 -07:00
|
|
|
feature = "net",
|
2020-04-24 06:25:48 -06:00
|
|
|
feature = "io-std",
|
2020-10-13 06:13:23 +09:00
|
|
|
feature = "rt",
|
2020-04-24 06:25:48 -06:00
|
|
|
))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-19 09:54:16 +01:00
|
|
|
/// Enables internal `AtomicWaker` impl.
|
2019-11-26 17:03:18 -08:00
|
|
|
macro_rules! cfg_atomic_waker_impl {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(any(
|
2020-10-13 03:36:26 +09:00
|
|
|
feature = "net",
|
2020-09-24 14:36:42 -07:00
|
|
|
feature = "process",
|
2020-10-13 06:13:23 +09:00
|
|
|
feature = "rt",
|
2020-09-24 14:36:42 -07:00
|
|
|
feature = "signal",
|
2019-11-26 17:03:18 -08:00
|
|
|
feature = "time",
|
|
|
|
|
))]
|
|
|
|
|
#[cfg(not(loom))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-15 10:55:50 -06:00
|
|
|
macro_rules! cfg_aio {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(all(any(docsrs, target_os = "freebsd"), feature = "net"))]
|
|
|
|
|
#[cfg_attr(docsrs,
|
|
|
|
|
doc(cfg(all(target_os = "freebsd", feature = "net")))
|
|
|
|
|
)]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-18 07:00:55 -08:00
|
|
|
macro_rules! cfg_fs {
|
2019-11-22 09:56:08 -08:00
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(feature = "fs")]
|
2022-07-26 13:26:54 +02:00
|
|
|
#[cfg(not(tokio_wasi))]
|
2019-11-22 09:56:08 -08:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "fs")))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
2019-11-18 07:00:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_io_blocking {
|
|
|
|
|
($($item:item)*) => {
|
2022-07-23 10:40:04 -07:00
|
|
|
$( #[cfg(any(
|
|
|
|
|
feature = "io-std",
|
|
|
|
|
feature = "fs",
|
|
|
|
|
all(windows, feature = "process"),
|
|
|
|
|
))] $item )*
|
2019-11-18 07:00:55 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_io_driver {
|
|
|
|
|
($($item:item)*) => {
|
2019-11-22 09:56:08 -08:00
|
|
|
$(
|
2020-09-24 14:36:42 -07:00
|
|
|
#[cfg(any(
|
2020-10-13 03:36:26 +09:00
|
|
|
feature = "net",
|
2022-07-23 10:40:04 -07:00
|
|
|
all(unix, feature = "process"),
|
2020-09-24 14:36:42 -07:00
|
|
|
all(unix, feature = "signal"),
|
|
|
|
|
))]
|
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(any(
|
2020-10-13 03:36:26 +09:00
|
|
|
feature = "net",
|
2022-07-23 10:40:04 -07:00
|
|
|
all(unix, feature = "process"),
|
2020-09-24 14:36:42 -07:00
|
|
|
all(unix, feature = "signal"),
|
|
|
|
|
))))]
|
2019-11-22 09:56:08 -08:00
|
|
|
$item
|
|
|
|
|
)*
|
2019-11-18 07:00:55 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-12 20:07:43 -08:00
|
|
|
macro_rules! cfg_io_driver_impl {
|
|
|
|
|
( $( $item:item )* ) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(any(
|
|
|
|
|
feature = "net",
|
2022-07-23 10:40:04 -07:00
|
|
|
all(unix, feature = "process"),
|
2020-11-12 20:07:43 -08:00
|
|
|
all(unix, feature = "signal"),
|
|
|
|
|
))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-18 07:00:55 -08:00
|
|
|
macro_rules! cfg_not_io_driver {
|
|
|
|
|
($($item:item)*) => {
|
2019-11-22 09:56:08 -08:00
|
|
|
$(
|
2020-09-24 14:36:42 -07:00
|
|
|
#[cfg(not(any(
|
2020-10-13 03:36:26 +09:00
|
|
|
feature = "net",
|
2022-07-23 10:40:04 -07:00
|
|
|
all(unix, feature = "process"),
|
2020-09-24 14:36:42 -07:00
|
|
|
all(unix, feature = "signal"),
|
|
|
|
|
)))]
|
2019-11-22 09:56:08 -08:00
|
|
|
$item
|
|
|
|
|
)*
|
2019-11-18 07:00:55 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-23 13:02:15 -07:00
|
|
|
macro_rules! cfg_io_readiness {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
2020-10-13 03:36:26 +09:00
|
|
|
#[cfg(feature = "net")]
|
2020-09-23 13:02:15 -07:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-18 07:00:55 -08:00
|
|
|
macro_rules! cfg_io_std {
|
|
|
|
|
($($item:item)*) => {
|
2019-11-22 09:56:08 -08:00
|
|
|
$(
|
|
|
|
|
#[cfg(feature = "io-std")]
|
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "io-std")))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
2019-11-18 07:00:55 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_io_util {
|
|
|
|
|
($($item:item)*) => {
|
2019-11-22 09:56:08 -08:00
|
|
|
$(
|
|
|
|
|
#[cfg(feature = "io-util")]
|
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "io-util")))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
2019-11-18 07:00:55 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_not_io_util {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$( #[cfg(not(feature = "io-util"))] $item )*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_loom {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$( #[cfg(loom)] $item )*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_not_loom {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$( #[cfg(not(loom))] $item )*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_macros {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(feature = "macros")]
|
2019-11-22 09:56:08 -08:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "macros")))]
|
2019-11-18 07:00:55 -08:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-21 22:17:38 -08:00
|
|
|
macro_rules! cfg_metrics {
|
2021-08-27 11:40:41 +02:00
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
2022-02-07 17:06:03 +08:00
|
|
|
// For now, metrics is only disabled in loom tests.
|
|
|
|
|
// When stabilized, it might have a dedicated feature flag.
|
|
|
|
|
#[cfg(all(tokio_unstable, not(loom)))]
|
2022-01-21 22:17:38 -08:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(tokio_unstable)))]
|
2021-08-27 11:40:41 +02:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-21 22:17:38 -08:00
|
|
|
macro_rules! cfg_not_metrics {
|
2021-08-27 11:40:41 +02:00
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
2022-02-07 17:06:03 +08:00
|
|
|
#[cfg(not(all(tokio_unstable, not(loom))))]
|
2021-08-27 11:40:41 +02:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-11 14:31:37 -05:00
|
|
|
macro_rules! cfg_not_rt_and_metrics_and_net {
|
2022-02-24 13:39:37 -05:00
|
|
|
($($item:item)*) => {
|
2022-05-11 14:31:37 -05:00
|
|
|
$( #[cfg(not(all(feature = "net", feature = "rt", all(tokio_unstable, not(loom)))))]$item )*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_net_or_process {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(any(feature = "net", feature = "process"))]
|
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(any(feature = "net", feature = "process"))))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
2022-02-24 13:39:37 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-13 03:36:26 +09:00
|
|
|
macro_rules! cfg_net {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(feature = "net")]
|
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_net_unix {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(all(unix, feature = "net"))]
|
2021-08-24 14:57:23 +02:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(all(unix, feature = "net"))))]
|
2020-10-13 03:36:26 +09:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-15 08:13:31 +02:00
|
|
|
macro_rules! cfg_net_windows {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
2021-08-03 09:07:38 +02:00
|
|
|
#[cfg(all(any(all(doc, docsrs), windows), feature = "net"))]
|
2021-06-15 08:13:31 +02:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(all(windows, feature = "net"))))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-18 07:00:55 -08:00
|
|
|
macro_rules! cfg_process {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(feature = "process")]
|
2019-11-22 09:56:08 -08:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "process")))]
|
2019-11-18 07:00:55 -08:00
|
|
|
#[cfg(not(loom))]
|
2022-07-26 13:26:54 +02:00
|
|
|
#[cfg(not(tokio_wasi))]
|
2019-11-18 07:00:55 -08:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-06 10:30:16 -07:00
|
|
|
macro_rules! cfg_process_driver {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
#[cfg(unix)]
|
|
|
|
|
#[cfg(not(loom))]
|
|
|
|
|
cfg_process! { $($item)* }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_not_process_driver {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(not(all(unix, not(loom), feature = "process")))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-18 07:00:55 -08:00
|
|
|
macro_rules! cfg_signal {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(feature = "signal")]
|
2019-11-25 14:32:55 -08:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "signal")))]
|
2019-11-18 07:00:55 -08:00
|
|
|
#[cfg(not(loom))]
|
2022-07-26 13:26:54 +02:00
|
|
|
#[cfg(not(tokio_wasi))]
|
2019-11-18 07:00:55 -08:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-24 10:51:46 -07:00
|
|
|
macro_rules! cfg_signal_internal {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(any(feature = "signal", all(unix, feature = "process")))]
|
|
|
|
|
#[cfg(not(loom))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-24 15:51:18 -07:00
|
|
|
macro_rules! cfg_signal_internal_and_unix {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
#[cfg(unix)]
|
|
|
|
|
cfg_signal_internal! { $($item)* }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-24 10:51:46 -07:00
|
|
|
macro_rules! cfg_not_signal_internal {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(any(loom, not(unix), not(any(feature = "signal", all(unix, feature = "process")))))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-18 07:00:55 -08:00
|
|
|
macro_rules! cfg_sync {
|
|
|
|
|
($($item:item)*) => {
|
2019-11-25 14:32:55 -08:00
|
|
|
$(
|
|
|
|
|
#[cfg(feature = "sync")]
|
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "sync")))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
2019-11-18 07:00:55 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_not_sync {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$( #[cfg(not(feature = "sync"))] $item )*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-13 06:13:23 +09:00
|
|
|
macro_rules! cfg_rt {
|
2019-12-01 12:49:38 -08:00
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
2020-10-13 06:13:23 +09:00
|
|
|
#[cfg(feature = "rt")]
|
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "rt")))]
|
2019-12-01 12:49:38 -08:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-13 06:13:23 +09:00
|
|
|
macro_rules! cfg_not_rt {
|
2020-10-12 13:44:54 -04:00
|
|
|
($($item:item)*) => {
|
2020-10-13 06:13:23 +09:00
|
|
|
$( #[cfg(not(feature = "rt"))] $item )*
|
2019-11-18 07:00:55 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-13 06:13:23 +09:00
|
|
|
macro_rules! cfg_rt_multi_thread {
|
2019-11-26 17:03:18 -08:00
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
2022-07-26 13:26:54 +02:00
|
|
|
#[cfg(all(feature = "rt-multi-thread", not(tokio_wasi)))]
|
2020-10-13 06:13:23 +09:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "rt-multi-thread")))]
|
2019-11-26 17:03:18 -08:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-13 06:13:23 +09:00
|
|
|
macro_rules! cfg_not_rt_multi_thread {
|
2019-11-18 07:00:55 -08:00
|
|
|
($($item:item)*) => {
|
2020-10-13 06:13:23 +09:00
|
|
|
$( #[cfg(not(feature = "rt-multi-thread"))] $item )*
|
2019-11-18 07:00:55 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_test_util {
|
|
|
|
|
($($item:item)*) => {
|
2019-11-25 14:32:55 -08:00
|
|
|
$(
|
|
|
|
|
#[cfg(feature = "test-util")]
|
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "test-util")))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
2019-11-18 07:00:55 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_not_test_util {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$( #[cfg(not(feature = "test-util"))] $item )*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_time {
|
|
|
|
|
($($item:item)*) => {
|
2019-11-25 14:32:55 -08:00
|
|
|
$(
|
|
|
|
|
#[cfg(feature = "time")]
|
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "time")))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
2019-11-18 07:00:55 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_not_time {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$( #[cfg(not(feature = "time"))] $item )*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-13 16:46:59 -07:00
|
|
|
macro_rules! cfg_trace {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
2020-12-14 17:22:31 -08:00
|
|
|
#[cfg(all(tokio_unstable, feature = "tracing"))]
|
2021-12-21 11:11:48 -08:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(all(tokio_unstable, feature = "tracing"))))]
|
2020-07-13 16:46:59 -07:00
|
|
|
$item
|
|
|
|
|
)*
|
2021-12-15 00:04:19 +02:00
|
|
|
};
|
2020-07-13 16:46:59 -07:00
|
|
|
}
|
|
|
|
|
|
2022-02-15 01:37:40 -08:00
|
|
|
macro_rules! cfg_unstable {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(tokio_unstable)]
|
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(tokio_unstable)))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-13 16:46:59 -07:00
|
|
|
macro_rules! cfg_not_trace {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
2020-12-14 17:22:31 -08:00
|
|
|
#[cfg(any(not(tokio_unstable), not(feature = "tracing")))]
|
2020-07-13 16:46:59 -07:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-06 19:02:07 -07:00
|
|
|
macro_rules! cfg_coop {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(any(
|
|
|
|
|
feature = "fs",
|
|
|
|
|
feature = "io-std",
|
2020-10-13 03:36:26 +09:00
|
|
|
feature = "net",
|
2020-05-06 19:02:07 -07:00
|
|
|
feature = "process",
|
2020-10-13 06:13:23 +09:00
|
|
|
feature = "rt",
|
2020-09-24 14:36:42 -07:00
|
|
|
feature = "signal",
|
2020-05-06 19:02:07 -07:00
|
|
|
feature = "sync",
|
2020-09-24 14:36:42 -07:00
|
|
|
feature = "time",
|
2020-05-06 19:02:07 -07:00
|
|
|
))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-03-09 18:10:15 +00:00
|
|
|
|
|
|
|
|
macro_rules! cfg_not_coop {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(not(any(
|
|
|
|
|
feature = "fs",
|
|
|
|
|
feature = "io-std",
|
|
|
|
|
feature = "net",
|
|
|
|
|
feature = "process",
|
|
|
|
|
feature = "rt",
|
|
|
|
|
feature = "signal",
|
|
|
|
|
feature = "sync",
|
|
|
|
|
feature = "time",
|
|
|
|
|
)))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-07-27 10:41:35 +02:00
|
|
|
|
|
|
|
|
macro_rules! cfg_has_atomic_u64 {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(not(any(
|
|
|
|
|
target_arch = "arm",
|
|
|
|
|
target_arch = "mips",
|
2021-10-20 12:25:00 -07:00
|
|
|
target_arch = "powerpc",
|
2022-07-12 16:20:26 -04:00
|
|
|
target_arch = "riscv32",
|
2022-07-26 13:26:54 +02:00
|
|
|
tokio_wasm
|
2021-07-27 10:41:35 +02:00
|
|
|
)))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_not_has_atomic_u64 {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(any(
|
|
|
|
|
target_arch = "arm",
|
|
|
|
|
target_arch = "mips",
|
2021-10-20 12:25:00 -07:00
|
|
|
target_arch = "powerpc",
|
2022-07-12 16:20:26 -04:00
|
|
|
target_arch = "riscv32",
|
2022-07-26 13:26:54 +02:00
|
|
|
tokio_wasm
|
2021-07-27 10:41:35 +02:00
|
|
|
))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-12 16:20:26 -04:00
|
|
|
|
2022-09-28 21:21:31 +02:00
|
|
|
macro_rules! cfg_has_const_mutex_new {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(all(
|
|
|
|
|
not(all(loom, test)),
|
|
|
|
|
any(
|
|
|
|
|
feature = "parking_lot",
|
|
|
|
|
not(tokio_no_const_mutex_new)
|
|
|
|
|
)
|
|
|
|
|
))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_not_has_const_mutex_new {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
|
|
|
|
#[cfg(not(all(
|
|
|
|
|
not(all(loom, test)),
|
|
|
|
|
any(
|
|
|
|
|
feature = "parking_lot",
|
|
|
|
|
not(tokio_no_const_mutex_new)
|
|
|
|
|
)
|
|
|
|
|
)))]
|
|
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-12 16:20:26 -04:00
|
|
|
macro_rules! cfg_not_wasi {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
2022-07-26 13:26:54 +02:00
|
|
|
#[cfg(not(tokio_wasi))]
|
2022-07-12 16:20:26 -04:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro_rules! cfg_is_wasm_not_wasi {
|
|
|
|
|
($($item:item)*) => {
|
|
|
|
|
$(
|
2022-07-26 13:26:54 +02:00
|
|
|
#[cfg(tokio_wasm_not_wasi)]
|
2022-07-12 16:20:26 -04:00
|
|
|
$item
|
|
|
|
|
)*
|
|
|
|
|
}
|
|
|
|
|
}
|