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.
21 lines
652 B
C++
21 lines
652 B
C++
#include <cstdarg>
|
|
#include <cstdint>
|
|
#include <cstdlib>
|
|
|
|
/// Constants shared by multiple CSS Box Alignment properties
|
|
/// These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
|
|
struct AlignFlags {
|
|
uint8_t bits;
|
|
};
|
|
static const AlignFlags AlignFlags_AUTO = (AlignFlags){ .bits = 0 };
|
|
static const AlignFlags AlignFlags_NORMAL = (AlignFlags){ .bits = 1 };
|
|
static const AlignFlags AlignFlags_START = (AlignFlags){ .bits = 1 << 1 };
|
|
static const AlignFlags AlignFlags_END = (AlignFlags){ .bits = 1 << 2 };
|
|
static const AlignFlags AlignFlags_FLEX_START = (AlignFlags){ .bits = 1 << 3 };
|
|
|
|
extern "C" {
|
|
|
|
void root(AlignFlags flags);
|
|
|
|
} // extern "C"
|