summaryrefslogtreecommitdiff
path: root/src/vec.h
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-02-10 11:40:59 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-02-10 11:40:59 +0100
commit0d62b836f33bd7029e769ffe1a823d7fcec0a8ff (patch)
tree312dce9c8359639951af4171e186f2872214b66a /src/vec.h
parent12a4aa2963369680fbc2df4a13731a1aed20db92 (diff)
use type decl
Diffstat (limited to 'src/vec.h')
-rw-r--r--src/vec.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vec.h b/src/vec.h
index 5cef8a3..6224574 100644
--- a/src/vec.h
+++ b/src/vec.h
@@ -11,7 +11,7 @@ struct raw_vec_s {
usize len, cap;
};
-#define WAYC_RAW_VEC_INIT(size) {nullptr, size, 0, 0}
+#define WAYC_RAW_VEC_INIT(size) raw_vec_s{nullptr, size, 0, 0}
void wayc_raw_vec_push(raw_vec_s *vec, const u8 *at);
bool wayc_raw_vec_pop(raw_vec_s *vec, u8 *out);
@@ -21,7 +21,8 @@ template <typename T> struct vec_s {
raw_vec_s raw;
};
-#define WAYC_VEC_INIT(type) {WAYC_RAW_VEC_INIT(sizeof(type))}
+#define WAYC_VEC_INIT(type) \
+ vec_s<type> { WAYC_RAW_VEC_INIT(sizeof(type)) }
template <typename T>
static inline void wayc_vec_push(vec_s<T> *vec, const T *at) {