commit 087348881cec39263c60dd3d97c2fc7f9e22294e
parent f17fb0c063247e2325e95f7137769e6b38876c42
Author: Louis Burda <quent.burda@gmail.com>
Date: Thu, 31 Mar 2022 12:23:06 +0200
Include type in iter macro
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/vec.h b/include/vec.h
@@ -1,13 +1,14 @@
#include <stdbool.h>
#include <stdlib.h>
-#define VEC_ITER(vec, var) \
- var = NULL; vec_iter(vec, &var);
+#define VEC_ITER(vec, type, var) \
+ var = (type*) NULL; vec_iter(vec, &var);
#define VEC_PUSH(vec, type, val) \
do { \
type tmp = (val); \
- vec_push(vec, &tmp); } while (0)
+ vec_push(vec, &tmp); \
+ } while (0)
#define VEC_POP(vec, type, var) \
do { \