97extern _Thread_local _pblock_jmp_buf_node *_ptry_top;
109#if defined(__GNUC__) && __GNUC__ >= 12
110#define ptDisablePtrWarning _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdangling-pointer\"")
111#define ptReenableWarnings _Pragma("GCC diagnostic pop")
113#define ptDisablePtrWarning
114#define ptReenableWarnings
146_meta_inline
void _ptry_clear(
void)
148 _ptry_exc = _ptry_exc_empty;
151_meta_inline
void _ptry_push(_pblock_jmp_buf_node *node)
153 node->next = _ptry_top;
159_meta_inline _pblock_jmp_buf_node *_ptry_pop(
void)
161 _pblock_jmp_buf_node *ret = _ptry_top;
165 _ptry_top = ret->next;
170_meta_inline
void _ptry_pop_until(_pblock_jmp_buf_node *node)
172 _pblock_jmp_buf_node *last;
176 }
while (last && last != node);
180_meta_inline
void _ptry_throw(
int code,
const char *msg,
const char *file,
int ln)
182_meta_inline
void _ptry_throw(
int code,
const char *msg)
186 _ptry_exc.
code = code;
189 _ptry_exc.file = file;
194 if (_ptry_top) _pbLongjmp(_ptry_top, -1);
197 _ptry_handle_unhandled(&_ptry_exc);
235#define ptThrow(code, msg) _ptry_throw(code, msg, __FILE__, __LINE__)
237#define ptThrow(code, msg) _ptry_throw(code, msg)
271#define ptRethrow _ptry_throw(_ptry_exc.code, _ptry_exc.msg, _ptry_exc.file, _ptry_exc.ln)
273#define ptRethrow _ptry_throw(_ptry_exc.code, _ptry_exc.msg)
310 for (unsigned _ptry_phase = 0; _ptry_phase < 2; ++_ptry_phase) \
315 _blkBefore(_ptry_push(_pblock_unwind_top)) \
319#define _ptry_after_block \
324 while(0); else case 1: \
328 _blkBefore(_ptry_phase = 2) \
330 _blkBefore(_ptry_pop_until(_pblock_unwind_top))
362 _blkAfter(_ptry_exc.code ? ptRethrow : nop_stmt)
411 _blkAfter(_ptry_clear())
434#define ptCode _ptry_exc.code
454#define ptMsg _ptry_exc.msg
Protected blocks with stack unwinding (advanced feature)
int code
Application-specific exception code.
const char * msg
Exception message - MUST be a static string literal.