Derive-C
Loading...
Searching...
No Matches
trait.c File Reference
#include <stdint.h>
#include <derive-c/prelude.h>

Go to the source code of this file.

Macros

#define Foo_REFLECT(F)

Functions

int main ()

Macro Definition Documentation

◆ Foo_REFLECT

#define Foo_REFLECT ( F)
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)

Function Documentation

◆ main()

int main ( )

Definition at line 15 of file trait.c.

15 {
16 Foo f = {.bing = 23, .baz = 'c', .zing = 'z'};
17 Foo g = {.bing = 23, .baz = 'c', .zing = 'z'};
18
19 DC_ASSERT(Foo_eq(&f, &g));
20 DC_ASSERT(!Foo_gt(&f, &g) && !Foo_lt(&f, &g));
21
22 Foo z = Foo_clone(&f);
23 z.bing += 10;
24 DC_ASSERT(Foo_gt(&z, &f));
25}
#define DC_ASSERT(expr,...)
Definition panic.h:37