29 lines
468 B
Rust
29 lines
468 B
Rust
#![doc(hidden)]
|
|
|
|
#[macro_export]
|
|
macro_rules! c_bitfield
|
|
{
|
|
(
|
|
$(#[$outer:meta])*
|
|
pub struct $t:ident: $ti:ty {
|
|
$(
|
|
$(#[$inner:ident $($args:tt)*])*
|
|
$f:ident = $v:expr
|
|
),+
|
|
$(,)?
|
|
}
|
|
) => {
|
|
bitflags! {
|
|
$(#[$outer])*
|
|
pub struct $t: $ti {
|
|
$(
|
|
$(#[$inner $($args)*])*
|
|
const $f = 1 << $v;
|
|
)+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// EOF
|