• 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             $item
19         )*
20     }
21 }
22 
23 macro_rules! cfg_time {
24     ($($item:item)*) => {
25         $(
26             #[cfg(feature = "time")]
27             $item
28         )*
29     }
30 }
31 
32 macro_rules! cfg_ffrt {
33     ($($item:item)*) => {
34         $(
35             #[cfg(feature = "ffrt")]
36             $item
37         )*
38     }
39 }
40 
41 #[cfg(not(feature = "ffrt"))]
42 macro_rules! cfg_event {
43     ($($item:item)*) => {
44         $(
45             #[cfg(any(feature = "net", feature = "time"))]
46             $item
47         )*
48     }
49 }
50 
51 macro_rules! cfg_not_ffrt {
52     ($($item:item)*) => {
53         $(
54             #[cfg(not(feature = "ffrt"))]
55             $item
56         )*
57     }
58 }
59 
60 macro_rules! cfg_metrics {
61     ($($item:item)*) => {
62         $(
63             #[cfg(feature = "metrics")]
64             $item
65         )*
66     }
67 }
68