BLI_link_utils: Add BLI_LINKS_APPEND(list, link)
This commit is contained in:
parent
11100faa5c
commit
d5a55b6918
|
@ -35,6 +35,18 @@
|
|||
list = link; \
|
||||
} (void)0
|
||||
|
||||
/* Use for append (single linked list, storing the last element). */
|
||||
#define BLI_LINKS_APPEND(list, link) { \
|
||||
(link)->next = NULL; \
|
||||
if ((list)->first) { \
|
||||
(list)->last->next = link; \
|
||||
} \
|
||||
else { \
|
||||
(list)->first = link; \
|
||||
} \
|
||||
(list)->last = link; \
|
||||
} (void)0
|
||||
|
||||
#define BLI_LINKS_FREE(list) { \
|
||||
while (list) { \
|
||||
void *next = list->next; \
|
||||
|
|
Loading…
Reference in New Issue