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.
20 lines
640 B
C
20 lines
640 B
C
#include <stdarg.h>
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
|
|
/**
|
|
* Constants shared by multiple CSS Box Alignment properties
|
|
* These constants match Gecko's `NS_STYLE_ALIGN_*` constants.
|
|
*/
|
|
typedef struct StyleAlignFlags {
|
|
uint8_t bits;
|
|
} StyleAlignFlags;
|
|
#define StyleAlignFlags_AUTO (StyleAlignFlags){ .bits = 0 }
|
|
#define StyleAlignFlags_NORMAL (StyleAlignFlags){ .bits = 1 }
|
|
#define StyleAlignFlags_START (StyleAlignFlags){ .bits = 1 << 1 }
|
|
#define StyleAlignFlags_END (StyleAlignFlags){ .bits = 1 << 2 }
|
|
#define StyleAlignFlags_FLEX_START (StyleAlignFlags){ .bits = 1 << 3 }
|
|
|
|
void root(StyleAlignFlags flags);
|