2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-25 11:18:27 +08:00

Add artiq_raise_from_c macro.

This commit is contained in:
whitequark 2015-07-27 13:56:18 +03:00
parent edffb40ef2
commit 244ace19e1

View File

@ -30,6 +30,19 @@ void __artiq_raise(struct artiq_exception *artiq_exn)
void __artiq_reraise()
__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 */
void __artiq_terminate(struct artiq_exception *artiq_exn,
struct artiq_backtrace_item *backtrace,