I am trying to define macro that would only expand to anything
if certain cfg option is defined, otherwise it should be no-op,
but I cannot find a way to do it. Pretty much I want some form of #ifdef.
The closest thing I can find is to enclose generated code in a function, and
just do this:
#cfg(foo)]
def foo(){
//do something
}
#[cfg(not(foo))]
def foo()){}
Is there a better way to do that?
--
Maciej Dziardziel
[email protected]
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev