Added a CLEANUP mechanism to the exception handling library. Fixed a bug in the way setjmp() return codes were being handled that lead to infinite loops in some cases, exceptions getting missed in others. Made FINALLY {} a required element (unfortunately).
This commit is contained in:
@@ -4,10 +4,13 @@ int main(void)
|
||||
{
|
||||
TRY {
|
||||
THROW_ZERO(NULL, EXC_NULLPOINTER, "I just threw with THROW_ZERO");
|
||||
} CLEANUP {
|
||||
} EXCEPT {
|
||||
} CATCH ( EXC_NULLPOINTER ) {
|
||||
THROW_NONZERO(strcmp("not", "equal"),
|
||||
3,
|
||||
"strcmp was nonzero!");
|
||||
} FINALLY {
|
||||
} ETRY;
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user