aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-05-21 17:57:15 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-05-21 17:57:15 +0200
commit114b88f931c7d99d88ad976f6e7c5bb67f1a830d (patch)
tree0f779185ea7d5199e59949400c2d7a361bf46688 /include
parent0553e9b92589a51a1b771da4a2001123cc8699cc (diff)
Add dafields()
Diffstat (limited to 'include')
-rw-r--r--include/dynarr.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/dynarr.h b/include/dynarr.h
index 78871cb..23705c9 100644
--- a/include/dynarr.h
+++ b/include/dynarr.h
@@ -19,12 +19,15 @@
#endif
/* clang-format on */
+#define dafields(T) \
+ T *buf; \
+ size_t len, cap; \
+ alloc_fn alloc; \
+ void *ctx;
+
#define dynarr(T) \
struct { \
- T *buf; \
- size_t len, cap; \
- alloc_fn alloc; \
- void *ctx; \
+ dafields(T) \
}
#define DAPUSH(da, x) \