• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2023 Huawei Device Co., Ltd.
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 //     http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 macro_rules! cfg_net {
15     ($($item:item)*) => {
16         $(
17             #[cfg(feature = "net")]
18             #[cfg_attr(doc_cfg, doc(cfg(feature = "net")))]
19             $item
20         )*
21     }
22 }
23 
24 macro_rules! cfg_time {
25     ($($item:item)*) => {
26         $(
27             #[cfg(feature = "time")]
28             #[cfg_attr(doc_cfg, doc(cfg(feature = "time")))]
29             $item
30         )*
31     }
32 }
33 
34 macro_rules! cfg_ffrt {
35     ($($item:item)*) => {
36         $(
37             #[cfg(feature = "ffrt")]
38             #[cfg_attr(doc_cfg, doc(cfg(feature = "ffrt")))]
39             $item
40         )*
41     }
42 }
43 
44 macro_rules! cfg_sync {
45     ($($item:item)*) => {
46         $(
47             #[cfg(feature = "sync")]
48             #[cfg_attr(doc_cfg, doc(cfg(feature = "sync")))]
49             $item
50         )*
51     }
52 }
53 
54 macro_rules! cfg_macros {
55     ($($item:item)*) => {
56         $(
57             #[cfg(feature = "macros")]
58             #[cfg_attr(doc_cfg, doc(cfg(feature = "macros")))]
59             $item
60         )*
61     }
62 }
63 
64 macro_rules! cfg_fs {
65     ($($item:item)*) => {
66         $(
67             #[cfg(feature = "fs")]
68             #[cfg_attr(doc_cfg, doc(cfg(feature = "fs")))]
69             $item
70         )*
71     }
72 }
73 
74 #[cfg(not(feature = "ffrt"))]
75 macro_rules! cfg_event {
76     ($($item:item)*) => {
77         $(
78             #[cfg(any(feature = "net", feature = "time"))]
79             $item
80         )*
81     }
82 }
83 
84 macro_rules! cfg_not_ffrt {
85     ($($item:item)*) => {
86         $(
87             #[cfg(not(feature = "ffrt"))]
88             $item
89         )*
90     }
91 }
92 
93 macro_rules! cfg_metrics {
94     ($($item:item)*) => {
95         $(
96             #[cfg(feature = "metrics")]
97             $item
98         )*
99     }
100 }
101