diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-05-10 02:46:35 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-05-10 03:29:34 +0400 |
commit | c3a3664e8c7b196091a786251293012002735b91 (patch) | |
tree | 5f28476f48df9f8c26356d6e33fa02720ad6bbe4 /source/blender/blenlib/BLI_linklist_stack.h | |
parent | fd26a32aa5336b6c5fd3e8a9fc5fc618b2590bb1 (diff) |
Utility macros for linklist stack & asserts for bmesh
Diffstat (limited to 'source/blender/blenlib/BLI_linklist_stack.h')
-rw-r--r-- | source/blender/blenlib/BLI_linklist_stack.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_linklist_stack.h b/source/blender/blenlib/BLI_linklist_stack.h index 1933dd733c3..5f4f98c5a4f 100644 --- a/source/blender/blenlib/BLI_linklist_stack.h +++ b/source/blender/blenlib/BLI_linklist_stack.h @@ -155,6 +155,13 @@ (_BLI_SMALLSTACK_CAST(var_src) ((_##var_src##_stack) ? \ (_BLI_SMALLSTACK_DEL_EX(var_src, var_dst), (_##var_dst##_free->link)) : NULL)) +#define BLI_SMALLSTACK_LAST(var) \ + (_BLI_SMALLSTACK_CAST(var) ((_##var##_stack) ? \ + _##var##_stack->link : NULL)) + +#define BLI_SMALLSTACK_IS_EMPTY(var) \ + (_BLI_SMALLSTACK_CAST(var) (_##var##_stack != NULL)) + /* loop over stack members last-added-first */ #define BLI_SMALLSTACK_ITER_BEGIN(var, item) \ { \ |