Changeset c3b9d639 for libcfa/src/exception.hfa
- Timestamp:
- May 26, 2022, 10:21:17 AM (19 months ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 5416b44
- Parents:
- c715e5f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/exception.hfa
rc715e5f rc3b9d639 18 18 // ----------------------------------------------------------------------------------------------- 19 19 20 // EHM_DEFAULT_VTABLE(exception_ name, (arguments))20 // EHM_DEFAULT_VTABLE(exception_type) 21 21 // Create a declaration for a (possibly polymorphic) default vtable. 22 #define EHM_DEFAULT_VTABLE(exception_name, arguments) \ 23 vtable(exception_name arguments) & const _default_vtable22 // Mostly used by and for the currency module. 23 #define EHM_DEFAULT_VTABLE(type) vtable(type) & const _default_vtable 24 24 25 // IS_EXCEPTION(exception_name [, (...parameters)]) 26 // IS_RESUMPTION_EXCEPTION(exception_name [, (parameters...)]) 27 // IS_TERMINATION_EXCEPTION(exception_name [, (parameters...)]) 28 // Create an assertion that exception_name, possibly with the qualifing parameters, is the given 29 // kind of exception with the standard vtable with the same parameters if applicable. 30 #define IS_EXCEPTION(...) _IS_EXCEPTION(is_exception, __VA_ARGS__, , ~) 31 #define IS_RESUMPTION_EXCEPTION(...) _IS_EXCEPTION(is_resumption_exception, __VA_ARGS__, , ~) 32 #define IS_TERMINATION_EXCEPTION(...) _IS_EXCEPTION(is_termination_exception, __VA_ARGS__, , ~) 33 #define _IS_EXCEPTION(kind, exception_name, parameters, ...) \ 34 kind(exception_name parameters, vtable(exception_name parameters)) 25 // IS_EXCEPTION(exception_type) 26 // IS_RESUMPTION_EXCEPTION(exception_type) 27 // IS_TERMINATION_EXCEPTION(exception_type) 28 // Create an assertion that exception_type is the given kind of exception. 29 // This is used to mimic associated types so the vtable type is unmentioned. 30 #define IS_EXCEPTION(type) is_exception(type, vtable(type)) 31 #define IS_RESUMPTION_EXCEPTION(type) is_resumption_exception(type, vtable(type)) 32 #define IS_TERMINATION_EXCEPTION(type) is_termination_exception(type, vtable(type))
Note: See TracChangeset
for help on using the changeset viewer.