80da1f59aa
Opt-in since it uses a C++17 feature, but this allow exactly the same usage in C++ and Rust, which I think is nice. This also fixes constants of transparent structs in general, since the initial version of this patch broke a test (associated constants in enums), so I added a test for that too.
23 lines
559 B
Rust
23 lines
559 B
Rust
bitflags! {
|
|
/// Constants shared by multiple CSS Box Alignment properties
|
|
///
|
|
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
|
|
#[derive(MallocSizeOf, ToComputedValue)]
|
|
#[repr(C)]
|
|
pub struct AlignFlags: u8 {
|
|
/// 'auto'
|
|
const AUTO = 0;
|
|
/// 'normal'
|
|
const NORMAL = 1;
|
|
/// 'start'
|
|
const START = 1 << 1;
|
|
/// 'end'
|
|
const END = 1 << 2;
|
|
/// 'flex-start'
|
|
const FLEX_START = 1 << 3;
|
|
}
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub extern "C" fn root(flags: AlignFlags) {}
|