diff options
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_link_utils.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_link_utils.h b/source/blender/blenlib/BLI_link_utils.h index 5322547ac08..7a1a13a6b31 100644 --- a/source/blender/blenlib/BLI_link_utils.h +++ b/source/blender/blenlib/BLI_link_utils.h @@ -47,6 +47,15 @@ (list)->last = link; \ } (void)0 +/* Use for inserting after a certain element. */ +#define BLI_LINKS_INSERT_AFTER(list, node, link) { \ + if ((node)->next == NULL) { \ + (list)->last = link; \ + } \ + (link)->next = (node)->next; \ + (node)->next = link; \ +} (void)0 + #define BLI_LINKS_FREE(list) { \ while (list) { \ void *next = list->next; \ |