irox_stats/macros.rs
1// SPDX-License-Identifier: MIT
2// Copyright 2024 IROX Contributors
3//
4
5/// Enables feature-specific code.
6/// Use this macro instead of `cfg(feature = "miniz")` to generate docs properly.
7#[macro_export]
8macro_rules! cfg_feature_miniz {
9 ($($item:item)*) => {
10 $(
11 #[cfg(any(all(doc, docsrs), feature = "miniz"))]
12 #[cfg_attr(docsrs, doc(cfg(feature = "miniz")))]
13 $item
14 )*
15 }
16}
17
18/// Enables feature-specific code.
19/// Use this macro instead of `cfg(feature = "std")` to generate docs properly.
20#[macro_export]
21macro_rules! cfg_feature_std {
22 ($($item:item)*) => {
23 $(
24 #[cfg(any(all(doc, docsrs), feature = "std"))]
25 #[cfg_attr(docsrs, doc(cfg(feature = "std")))]
26 $item
27 )*
28 }
29}