Derive-C
Loading...
Searching...
No Matches
ord.h
Go to the documentation of this file.
1#include <derive-c/core.h>
2#include <stdbool.h>
3
4#define DERIVE_ORD_MEMBER_GT(t, n) || NAME(t, gt)(&self_1->n, &self_2->n)
5#define DERIVE_ORD_MEMBER_LT(t, n) || NAME(t, lt)(&self_1->n, &self_2->n)
6
7#define DERIVE_ORD(ID) \
8 bool NAME(ID, gt)(ID const* self_1, ID const* self_2) { \
9 return false NAME(ID, REFLECT)(DERIVE_ORD_MEMBER_GT); \
10 } \
11 bool NAME(ID, lt)(ID const* self_1, ID const* self_2) { \
12 return false NAME(ID, REFLECT)(DERIVE_ORD_MEMBER_LT); \
13 }