59enum _pblock_unwind_const { _pblock_unwind_top = 0 };
63typedef struct _pblock_jmp_buf_node _pblock_jmp_buf_node;
64typedef struct _pblock_jmp_buf_node {
65 _pblock_jmp_buf_node* next;
68} _pblock_jmp_buf_node;
70typedef _pblock_jmp_buf_node _pblock_jmp_buf[1];
71#define BLOCK_JMPBUF_INIT \
73 [0] = {.target = 0 } \
76_meta_inline
void _pbLongjmp(_pblock_jmp_buf_node* node,
int val)
79 longjmp(node->buf, 1);
127 _blkStart _inhibitReturn \
128 _blkDef(volatile bool _pblock_unwind = false) \
129 _blkFull( volatile int _pblock_target = 0, \
140 pblockUnwind(_pblock_target <= 0 ? _pblock_target : _pblock_target - 1) : \
143 _blkDef(_pblock_jmp_buf \
144 _pblock_unwind_top = tokeval(BLOCK_JMPBUF_INIT))
148 switch (setjmp(_pblock_unwind_top[0] \
161 _pblock_target = _pblock_unwind_top[0].target; \
162 _pblock_unwind = !!_pblock_target; \
168_meta_inline
void _pblockUnwind(
void* top,
int cond)
171 _pbLongjmp(top, cond);
203#define pblockUnwind(num) _pblockUnwind((void*)_pblock_unwind_top, (num))
235#define PBLOCK_AFTER \
242 _pblock_target = _pblock_unwind_top[0].target; \
243 _pblock_unwind = !!_pblock_target; \
Block wrapping macros for automatic resource management.
Macros for suppressing compiler warnings.