mirror of https://github.com/m-labs/artiq.git
Add artiq_raise_from_c macro.
This commit is contained in:
parent
edffb40ef2
commit
244ace19e1
|
@ -30,6 +30,19 @@ void __artiq_raise(struct artiq_exception *artiq_exn)
|
||||||
void __artiq_reraise()
|
void __artiq_reraise()
|
||||||
__attribute__((noreturn));
|
__attribute__((noreturn));
|
||||||
|
|
||||||
|
#define artiq_raise_from_c(exnname, exnmsg, exnparam0, exnparam1, exnparam2) \
|
||||||
|
do { \
|
||||||
|
struct artiq_exception exn = { \
|
||||||
|
.name = exnname, \
|
||||||
|
.message = exnmsg, \
|
||||||
|
.param = { exnparam0, exnparam1, exnparam2 }, \
|
||||||
|
.file = __FILE__, \
|
||||||
|
.line = __LINE__, \
|
||||||
|
.column = 0 \
|
||||||
|
}; \
|
||||||
|
__artiq_raise(&exn); \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
/* Called by the runtime */
|
/* Called by the runtime */
|
||||||
void __artiq_terminate(struct artiq_exception *artiq_exn,
|
void __artiq_terminate(struct artiq_exception *artiq_exn,
|
||||||
struct artiq_backtrace_item *backtrace,
|
struct artiq_backtrace_item *backtrace,
|
||||||
|
|
Loading…
Reference in New Issue