Files
cbindgen/tests/expectations/prefixed_struct_literal.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

15 lines
271 B
C

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef struct {
int32_t a;
uint32_t b;
} PREFIXFoo;
#define PREFIXFoo_FOO (PREFIXFoo){ .a = 42, .b = 47 }
#define PREFIXBAR (PREFIXFoo){ .a = 42, .b = 1337 }
void root(PREFIXFoo x);