Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/exception.h

    rc960331 r69c5c00  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // exception.h -- Internal exception handling definitions.
     7// exception.h -- Builtins for exception handling.
    88//
    99// Author           : Andrew Beach
    1010// Created On       : Mon Jun 26 15:11:00 2017
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tue Oct 27 14:45:00 2020
    13 // Update Count     : 11
     12// Last Modified On : Tue May 19 14:17:00 2020
     13// Update Count     : 10
    1414//
    1515
    1616#pragma once
    1717
    18 // This could be considered several headers. All are internal to the exception
    19 // system but needed to depending on whether they are C/Cforall code and
    20 // whether or not they are part of the builtins.
    2118
    2219#ifdef __cforall
    2320extern "C" {
    2421#endif
    25 
    26 // Included in C code or the built-ins.
    27 #if !defined(__cforall) || defined(__cforall_builtins__)
    2822
    2923struct __cfaehm_base_exception_t;
     
    5347// Function catches termination exceptions.
    5448void __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));
    5852
    5953// Clean-up the exception in catch blocks.
     
    6256// Data structure creates a list of resume handlers.
    6357struct __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);
    6660};
    6761
    6862// These act as constructor and destructor for the resume node.
    6963void __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));
    7266void __cfaehm_try_resume_cleanup(
    73         struct __cfaehm_try_resume_node * node);
     67    struct __cfaehm_try_resume_node * node);
    7468
    7569// Check for a standard way to call fake deconstructors.
    7670struct __cfaehm_cleanup_hook {};
    7771
    78 #endif
    79 
    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 #endif
    93 
    9472#ifdef __cforall
    9573}
    96 
    97 // Built-ins not visible in C.
    98 #if defined(__cforall_builtins__)
    9974
    10075// Not all the built-ins can be expressed in C. These can't be
     
    149124
    150125#endif
    151 
    152 #endif
Note: See TracChangeset for help on using the changeset viewer.