Changes in libcfa/src/exception.h [c960331:69c5c00]
- File:
-
- 1 edited
-
libcfa/src/exception.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/exception.h
rc960331 r69c5c00 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // exception.h -- Internal exception handling definitions.7 // exception.h -- Builtins for exception handling. 8 8 // 9 9 // Author : Andrew Beach 10 10 // Created On : Mon Jun 26 15:11:00 2017 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Tue Oct 27 14:45:00 202013 // Update Count : 1 112 // Last Modified On : Tue May 19 14:17:00 2020 13 // Update Count : 10 14 14 // 15 15 16 16 #pragma once 17 17 18 // This could be considered several headers. All are internal to the exception19 // system but needed to depending on whether they are C/Cforall code and20 // whether or not they are part of the builtins.21 18 22 19 #ifdef __cforall 23 20 extern "C" { 24 21 #endif 25 26 // Included in C code or the built-ins.27 #if !defined(__cforall) || defined(__cforall_builtins__)28 22 29 23 struct __cfaehm_base_exception_t; … … 53 47 // Function catches termination exceptions. 54 48 void __cfaehm_try_terminate( 55 void (*try_block)(),56 void (*catch_block)(int index, exception_t * except),57 int (*match_block)(exception_t * except));49 void (*try_block)(), 50 void (*catch_block)(int index, exception_t * except), 51 int (*match_block)(exception_t * except)); 58 52 59 53 // Clean-up the exception in catch blocks. … … 62 56 // Data structure creates a list of resume handlers. 63 57 struct __cfaehm_try_resume_node { 64 struct __cfaehm_try_resume_node * next;65 _Bool (*handler)(exception_t * except);58 struct __cfaehm_try_resume_node * next; 59 _Bool (*handler)(exception_t * except); 66 60 }; 67 61 68 62 // These act as constructor and destructor for the resume node. 69 63 void __cfaehm_try_resume_setup( 70 struct __cfaehm_try_resume_node * node,71 _Bool (*handler)(exception_t * except));64 struct __cfaehm_try_resume_node * node, 65 _Bool (*handler)(exception_t * except)); 72 66 void __cfaehm_try_resume_cleanup( 73 struct __cfaehm_try_resume_node * node);67 struct __cfaehm_try_resume_node * node); 74 68 75 69 // Check for a standard way to call fake deconstructors. 76 70 struct __cfaehm_cleanup_hook {}; 77 71 78 #endif79 80 // Included in C code and the library.81 #if !defined(__cforall) || !defined(__cforall_builtins__)82 struct __cfaehm_node {83 struct _Unwind_Exception unwind_exception;84 struct __cfaehm_node * next;85 int handler_index;86 };87 88 static inline exception_t * __cfaehm_cancellation_exception(89 struct _Unwind_Exception * unwind_exception ) {90 return (exception_t *)(1 + (struct __cfaehm_node *)unwind_exception);91 }92 #endif93 94 72 #ifdef __cforall 95 73 } 96 97 // Built-ins not visible in C.98 #if defined(__cforall_builtins__)99 74 100 75 // Not all the built-ins can be expressed in C. These can't be … … 149 124 150 125 #endif 151 152 #endif
Note:
See TracChangeset
for help on using the changeset viewer.