Derive-C
Loading...
Searching...
No Matches
general.c File Reference
#include <stdint.h>
#include <derive-c/core/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(double, zing)

Definition at line 5 of file general.c.

5#define Foo_REFLECT(F) \
6 F(uint32_t, bing) \
7 F(char, baz) \
8 F(double, zing)

Function Documentation

◆ main()

int main ( )

Definition at line 15 of file general.c.

15 {
16 Foo f = {.bing = 23, .baz = 'c', .zing = 3.14};
17 Foo g = {.bing = 23, .baz = 'c', .zing = 3.14};
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:36