- File:
-
- 1 edited
-
tests/exceptions/conditional.cfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/conditional.cfa
re68d092 r6d43cdde 4 4 // up the non-trivial exception is reasonable to do. 5 5 6 #include <exception.hfa>6 #include "except-mac.hfa" 7 7 #include <stdio.h> 8 8 9 VTABLE_DECLARATION(num_error)( 9 DECLARE_EXCEPT(num_error, BASE_EXCEPT, 10 10 int (*code)(num_error *this); 11 11 ); … … 36 36 this.num = other.num; 37 37 } 38 void copy(num_error * this, num_error * other) { 39 *this = *other; 40 } 38 41 void ^?{}(num_error & this) { 39 42 if( this.msg ) free( this.msg ); … … 43 46 } 44 47 45 VTABLE_INSTANCE(num_error)( 46 num_error_msg, 47 num_error_code, 48 VTABLE_INSTANCE(num_error, BASE_EXCEPT, copy, ^?{}, 49 num_error_msg, num_error_code 48 50 ); 49 51 … … 56 58 57 59 try { 58 throw &exc;60 THROW(&exc); 59 61 } catch (num_error * error ; 3 == error->virtual_table->code( error )) { 60 62 caught_num_error(3, error); … … 64 66 65 67 try { 66 throwResume &exc;68 THROW_RESUME(&exc); 67 69 } catchResume (num_error * error ; 3 == error->virtual_table->code( error )) { 68 70 caught_num_error(3, error);
Note:
See TracChangeset
for help on using the changeset viewer.