irox_stats/
macros.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-License-Identifier: MIT
// Copyright 2024 IROX Contributors
//

/// Enables feature-specific code.
/// Use this macro instead of `cfg(feature = "miniz")` to generate docs properly.
#[macro_export]
macro_rules! cfg_feature_miniz {
    ($($item:item)*) => {
        $(
            #[cfg(any(all(doc, docsrs), feature = "miniz"))]
            #[cfg_attr(docsrs, doc(cfg(feature = "miniz")))]
            $item
        )*
    }
}

/// Enables feature-specific code.
/// Use this macro instead of `cfg(feature = "std")` to generate docs properly.
#[macro_export]
macro_rules! cfg_feature_std {
    ($($item:item)*) => {
        $(
            #[cfg(any(all(doc, docsrs), feature = "std"))]
            #[cfg_attr(docsrs, doc(cfg(feature = "std")))]
            $item
        )*
    }
}