Lichen

templates/exceptions.h

228:c3935cc7b5b6
2016-11-23 Paul Boddie Sketched out the attribute inspection support somewhat.
     1 #ifndef __EXCEPTIONS_H__     2 #define __EXCEPTIONS_H__     3      4 #include "cexcept.h"     5 #include "types.h"     6      7 /* Define the exception type. */     8      9 typedef struct    10 {    11     __attr arg;    12     int raising;    13     int raising_else;    14     int completing;    15 } __exc;    16     17 define_exception_type(__exc);    18 #undef define_exception_type    19     20 extern struct __exception_context __the_exception_context[1];    21     22 /* More specific macros. */    23     24 #define __Raise(value) __Throw ((__exc) {value, 1, 0, 0})    25 #define __RaiseElse(value) __Throw ((__exc) {value, 0, 1, 0})    26 #define __Return(value) __Throw ((__exc) {value, 0, 0, 1})    27 #define __Complete __Throw((__exc) {__NULL, 0, 0, 1})    28     29 #endif /* __EXCEPTIONS_H__ */