Skip to content

Commit 6fa2149

Browse files
committed
list fix: 'for' loop initial declarations are only allowed in C99.
1 parent 409fe80 commit 6fa2149

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

list.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ void list_free(struct list* list);
1717
void list_insert(struct list* list, void* data);
1818

1919
#define list_foreach(list, list_item_name) \
20-
for(struct list_item* list_item_name = list->first; \
20+
struct list_item* list_item_name; \
21+
for(list_item_name = list->first; \
2122
list_item_name != NULL; \
2223
list_item_name = list_item_name->next)
2324

0 commit comments

Comments
 (0)