Macro cfgenius::define

source ·
macro_rules! define {
    (
        $( $vis:vis $name:ident = $pred:ident ($($pred_args:tt)*) );* $(;)?
    ) => { ... };
}
Expand description

Defines a zero or more conditional-compilation variables which evaluate to the provided cfgenius predicate.

These merely desugar to use items of truthy! and falsy!.

§Syntax

define! {
    <visibility> <name> = <predicate>
}

…or, if you want to define more than one predicate:

define! {
    <visibility 1> <name 1> = <predicate 1>;
    <visibility 2> <name 2> = <predicate 2>;
    // ...
    <visibility N> <name N> = <predicate N> // <-- the semicolon is optional.
}

See the predicates section of the crate documentation for more information about the predicate grammar.

See also the custom variable section of the crate documentation for information how to define more complex variables, potentially with arguments.