Refactor proc macros, add more knobs (#2022)

* Refactor proc macros, add more knobs

* make macros work with rt-core
This commit is contained in:
Artem Vorotnikov
2019-12-27 13:56:43 -05:00
committed by Lucio Franco
parent a515f9c459
commit e8fcf55881
3 changed files with 248 additions and 125 deletions
+2 -2
View File
@@ -54,7 +54,7 @@ io-driver = ["mio", "lazy_static"]
io-util = ["memchr"]
# stdin, stdout, stderr
io-std = ["rt-core"]
macros = ["tokio-macros"]
macros = ["rt-core", "tokio-macros"]
net = ["dns", "tcp", "udp", "uds"]
process = [
"io-driver",
@@ -92,7 +92,7 @@ uds = ["io-driver", "mio-uds", "libc"]
[dependencies]
tokio-macros = { version = "0.2.0", optional = true }
tokio-macros = { version = "0.2.0", path = "../tokio-macros", optional = true }
bytes = "0.5.0"
pin-project-lite = "0.1.1"
+11 -3
View File
@@ -264,9 +264,17 @@ cfg_time! {
mod util;
cfg_macros! {
#[cfg(not(test))] // Work around for rust-lang/rust#62127
pub use tokio_macros::main;
pub use tokio_macros::test;
cfg_rt_threaded! {
#[cfg(not(test))] // Work around for rust-lang/rust#62127
pub use tokio_macros::main_threaded as main;
pub use tokio_macros::test_threaded as test;
}
cfg_not_rt_threaded! {
#[cfg(not(test))] // Work around for rust-lang/rust#62127
pub use tokio_macros::main_basic as main;
pub use tokio_macros::test_basic as test;
}
}
// Tests