diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/arr.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -51,5 +51,6 @@ static void arr_free(Array *arr) { free(arr->data); } +/* NOTE: this will not work if type is a pointer! */ #define arr_foreach(arr, type, var) for (type *var = (arr)->data, *var##_foreach_last = arr_last(arr); var; var == var##_foreach_last ? var = NULL : var++) #define arr_foreach_reverse(arr, type, var) for (type *var = arr_last(arr); var; var == (arr)->data ? var = NULL : var--) |