- File:
-
- 1 edited
-
doc/working/exception/impl/test-main.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/working/exception/impl/test-main.c
r35ba584c r6a48cc9 289 289 // Terminate Rethrow: 290 290 // I don't have an implementation for this. 291 void reterminate() {292 {293 void fn_try1() {294 void fn_try2() {295 terminate(1);296 }297 void fn_catch2(int index, exception except) {298 switch (index) {299 case 1:300 printf("reterminate 2 caught and "301 "will rethrow exception 1\n");302 __rethrow_terminate();303 break;304 default:305 printf("INVALID INDEX in reterminate 2: %d (%d)\n",306 index, except);307 }308 }309 int fn_match2(exception except) {310 if (1 == except) {311 return 1;312 } else {313 return 0;314 }315 }316 __try_terminate(fn_try2, fn_catch2, fn_match2);317 }318 void fn_catch1(int index, exception except) {319 switch (index) {320 case 1:321 printf("reterminate 1 caught exception 1\n");322 break;323 default:324 printf("INVALID INDEX in reterminate 1: %d (%d)\n",325 index, except);326 }327 }328 int fn_match1(exception except) {329 if (1 == except) {330 return 1;331 } else {332 return 0;333 }334 }335 __try_terminate(fn_try1, fn_catch1, fn_match1);336 }337 }338 291 339 292 // Resume Rethrow: … … 475 428 terminate_swapped(); printf("\n"); 476 429 resume_swapped(); printf("\n"); 477 reterminate(); printf("\n");478 430 reresume(); printf("\n"); 479 431 fee(); printf("\n");
Note:
See TracChangeset
for help on using the changeset viewer.