source: doc/working/exception/impl/exception.h @ 7c17511

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 7c17511 was 35dd0f42, checked in by Andrew Beach <ajbeach@…>, 7 years ago

Work in progress combined file for both types of exceptions.

  • Property mode set to 100644
File size: 887 bytes
Line 
1// Trying to create the new secret header for the exception handling mechanism.
2
3// This will have to go in the public header later.
4typedef int exception;
5
6
7
8// These might be given simpler names and made public.
9void __throw_terminate(exception except) __attribute__((noreturn));
10void __throw_resume(exception except);
11
12void __try_terminate(void (*try_block)(),
13        void (*catch_block)(int index, exception except),
14        int (*match_block)(exception except));
15
16struct __try_resume_node {
17        struct __try_resume_node * next;
18        _Bool (*try_to_handle)(exception except);
19};
20
21struct __cleanup_hook {};
22
23
24// When I have it working in a single threaded environment.
25struct shared_stack_t {
26        //struct lock lock;
27        struct __try_resume_node * top_resume;
28        struct __try_resume_node * current_resume;
29
30        exception current_exception;
31        int current_handler_index;
32};
33
34extern struct shared_stack_t stared_stack;
Note: See TracBrowser for help on using the repository browser.