summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWormHeamer2025-02-06 02:50:50 -0500
committerWormHeamer2025-02-06 02:50:50 -0500
commit628a2a17b64097c884630e1cc02e1e10e8b97020 (patch)
tree6ad4f9a30fb6fba6cf9c70aee89216884e84db2c
parentbedbdc17d21ba89b37b1d3e55c0cd06e19026749 (diff)
use "variadic" args in DA_PUSH to allow for (struct) {x, y, z...}
-rw-r--r--dynarr.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/dynarr.h b/dynarr.h
index d7f9072..986c6ab 100644
--- a/dynarr.h
+++ b/dynarr.h
@@ -33,9 +33,9 @@ typedef struct { size_t count, capacity; } DynArrHeader;
(da) = (void *)(da_fit_ptr + sizeof(DynArrHeader));\
}
-#define DA_PUSH(da, item) {\
+#define DA_PUSH(da, ...) {\
DA_FIT(da, DA_LEN(da) + 1);\
- (da)[DA_HEADER(da)->count++] = item;\
+ (da)[DA_HEADER(da)->count++] = (__VA_ARGS__);\
}
#define DA_PUSH_MULT(da, buf, n) {\