File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 24
24
//! static FlagC = 0x00000100,
25
25
//! static FlagABC = FlagA.bits
26
26
//! | FlagB.bits
27
- //! | FlagC.bits
27
+ //! | FlagC.bits,
28
28
//! }
29
29
//! )
30
30
//!
46
46
//! bitflags!(
47
47
//! flags Flags: u32 {
48
48
//! static FlagA = 0x00000001,
49
- //! static FlagB = 0x00000010
49
+ //! static FlagB = 0x00000010,
50
50
//! }
51
51
//! )
52
52
//!
@@ -215,7 +215,17 @@ macro_rules! bitflags(
215
215
$BitFlags { bits: !self . bits } & $BitFlags:: all( )
216
216
}
217
217
}
218
- )
218
+ ) ;
219
+ ( $( #[ $attr: meta] ) * flags $BitFlags: ident: $T: ty {
220
+ $( $( #[ $Flag_attr: meta] ) * static $Flag: ident = $value: expr) ,+,
221
+ } ) => (
222
+ bitflags!(
223
+ $( #[ $attr] ) *
224
+ flags $BitFlags: u32 {
225
+ $( $( #[ $Flag_attr] ) * static $Flag = $value) ,+
226
+ }
227
+ )
228
+ ) ;
219
229
)
220
230
221
231
#[ cfg( test) ]
@@ -231,7 +241,7 @@ mod tests {
231
241
static FlagC = 0x00000100 ,
232
242
static FlagABC = FlagA . bits
233
243
| FlagB . bits
234
- | FlagC . bits
244
+ | FlagC . bits,
235
245
}
236
246
)
237
247
You can’t perform that action at this time.
0 commit comments