Changeset 77bc259 for libcfa/src


Ignore:
Timestamp:
Feb 12, 2024, 1:07:26 PM (9 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
c185ca9
Parents:
6b228cae
Message:

move exception macro to general location, update more code to use macros

Location:
libcfa/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/Exception.hfa

    r6b228cae r77bc259  
    22
    33// TEMPORARY
    4 #define ExceptionDecl( name, fields... ) exception name{ fields }; __attribute__(( cfa_linkonce )) vtable( name ) name ## _vt
    5 #define ExceptionInst( name, values... ) (name){ &name ## _vt, values }
     4#define ExceptionDecl( name, fields... ) exception name{ fields }; \
     5        __attribute__(( cfa_linkonce )) vtable( name ) name ## _vt
     6#define ExceptionArgs( name, args... ) &name ## _vt, args
     7#define ExceptionInst( name, args... ) (name){ ExceptionArgs( name, args ) }
  • libcfa/src/fstream.cfa

    r6b228cae r77bc259  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Feb  1 18:32:15 2024
    13 // Update Count     : 575
     12// Last Modified On : Sun Feb 11 20:55:45 2024
     13// Update Count     : 580
    1414//
    1515
     
    321321
    322322
    323 static vtable(open_failure) open_failure_vt;
    324 
    325323// exception I/O constructors
    326324void ?{}( open_failure & ex, ofstream & ostream ) with( ex ) {
     
    337335
    338336
    339 static vtable(close_failure) close_failure_vt;
    340 
    341337// exception I/O constructors
    342338void ?{}( close_failure & ex, ofstream & ostream ) with( ex ) {
     
    353349
    354350
    355 static vtable(write_failure) write_failure_vt;
    356 
    357351// exception I/O constructors
    358352void ?{}( write_failure & ex, ofstream & ostream ) with( ex ) {
     
    369363
    370364
    371 static vtable(read_failure) read_failure_vt;
    372 
    373365// exception I/O constructors
    374366void ?{}( read_failure & ex, ofstream & ostream ) with( ex ) {
  • libcfa/src/fstream.hfa

    r6b228cae r77bc259  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Oct 18 20:30:12 2023
    13 // Update Count     : 261
     12// Last Modified On : Sun Feb 11 20:35:00 2024
     13// Update Count     : 274
    1414//
    1515
     
    139139
    140140
    141 exception open_failure {
     141ExceptionDecl( open_failure,
    142142        union {
    143143                ofstream * ostream;
     
    146146        // TEMPORARY: need polymorphic exceptions
    147147        int tag;                                                                                        // 1 => ostream; 0 => istream
    148 };
     148);
    149149
    150150void ?{}( open_failure & this, ofstream & );
    151151void ?{}( open_failure & this, ifstream & );
    152152
    153 exception close_failure {
     153ExceptionDecl( close_failure,
    154154        union {
    155155                ofstream * ostream;
     
    158158        // TEMPORARY: need polymorphic exceptions
    159159        int tag;                                                                                        // 1 => ostream; 0 => istream
    160 };
     160);
    161161
    162162void ?{}( close_failure & this, ofstream & );
    163163void ?{}( close_failure & this, ifstream & );
    164164
    165 exception write_failure {
     165ExceptionDecl( write_failure,
    166166        union {
    167167                ofstream * ostream;
     
    170170        // TEMPORARY: need polymorphic exceptions
    171171        int tag;                                                                                        // 1 => ostream; 0 => istream
    172 };
     172);
    173173
    174174void ?{}( write_failure & this, ofstream & );
    175175void ?{}( write_failure & this, ifstream & );
    176176
    177 exception read_failure {
     177ExceptionDecl( read_failure,
    178178        union {
    179179                ofstream * ostream;
     
    182182        // TEMPORARY: need polymorphic exceptions
    183183        int tag;                                                                                        // 1 => ostream; 0 => istream
    184 };
     184);
    185185
    186186void ?{}( read_failure & this, ofstream & );
Note: See TracChangeset for help on using the changeset viewer.