Files
cbindgen/tests/expectations/both/bitflags.c
T
Emilio Cobos Álvarez 80da1f59aa Allow to generate associated constants in the body of C++ structs.
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.
2019-02-23 17:58:22 -08:00

20 lines
575 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 AlignFlags {
uint8_t bits;
} AlignFlags;
#define AlignFlags_AUTO (AlignFlags){ .bits = 0 }
#define AlignFlags_NORMAL (AlignFlags){ .bits = 1 }
#define AlignFlags_START (AlignFlags){ .bits = 1 << 1 }
#define AlignFlags_END (AlignFlags){ .bits = 1 << 2 }
#define AlignFlags_FLEX_START (AlignFlags){ .bits = 1 << 3 }
void root(AlignFlags flags);