59enum _pblock_unwind_const {
60 _pblock_unwind_top = 0
65typedef struct _pblock_jmp_buf_node _pblock_jmp_buf_node;
66typedef struct _pblock_jmp_buf_node {
67 _pblock_jmp_buf_node *next;
70} _pblock_jmp_buf_node;
72typedef _pblock_jmp_buf_node _pblock_jmp_buf[1];
73#define BLOCK_JMPBUF_INIT {[0] = {.target = 0}}
75_meta_inline
void _pbLongjmp(_pblock_jmp_buf_node *node,
int val)
78 longjmp(node->buf, 1);
128 _blkDef(volatile bool _pblock_unwind = false) \
129 _blkFull( volatile int _pblock_target = 0, true, \
138 pblockUnwind(_pblock_target <= 0 ? _pblock_target : _pblock_target - 1) : nop_stmt)) \
140 _blkDef(_pblock_jmp_buf _pblock_unwind_top = tokeval(BLOCK_JMPBUF_INIT)) \
142 switch(setjmp(_pblock_unwind_top[0].buf)) \
152 _pblock_target = _pblock_unwind_top[0].target; \
153 _pblock_unwind = !!_pblock_target; \
160_meta_inline
void _pblockUnwind(
void *top,
int cond)
162 if (cond && top) _pbLongjmp(top, cond);
194#define pblockUnwind(num) _pblockUnwind((void*)_pblock_unwind_top, (num))
226#define PBLOCK_AFTER \
233 _pblock_target = _pblock_unwind_top[0].target; \
234 _pblock_unwind = !!_pblock_target; \
Block wrapping macros for automatic resource management.
Macros for suppressing compiler warnings.