#include <stdint.h>
#include <derive-c/prelude.h>
Go to the source code of this file.
◆ Foo_REFLECT
Value:F(uint32_t, bing) \
F(char, baz) \
F(char, zing)
Definition at line 5 of file trait.c.
5#define Foo_REFLECT(F) \
6 F(uint32_t, bing) \
7 F(char, baz) \
8 F(char, zing)
◆ example_trait()
Definition at line 15 of file trait.c.
15 {
17
18 Foo f = {.bing = 23, .baz = 'c', .zing = 'z'};
19 Foo g = {.bing = 23, .baz = 'c', .zing = 'z'};
20
24 DC_ASSERT(!Foo_gt(&f, &g) && !Foo_lt(&f, &g));
25
27 Foo z = Foo_clone(&f);
28 z.bing += 10;
31}
#define DC_ASSERT(expr,...)
#define DC_SCOPED(type,...)
RAII in C. Call the destructor when the variable goes out of scope.
#define DC_LOGGER_NEW(...)
◆ main()
Definition at line 33 of file trait.c.
33 {
36 new_global)((
NS(
DC_LOGGER, global_config)){.stream = stdout, .ansi_colours =
true},
38
40 return 0;
41}
static void example_trait(DC_LOGGER *parent)