diff options
Diffstat (limited to 'src/rt/rust_internal.h')
| -rw-r--r-- | src/rt/rust_internal.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/rt/rust_internal.h b/src/rt/rust_internal.h index 05463c53..67787719 100644 --- a/src/rt/rust_internal.h +++ b/src/rt/rust_internal.h @@ -10,6 +10,7 @@ #include <stdlib.h> #include <stdint.h> #include <inttypes.h> +#include <stdarg.h> #include <stdio.h> #include <string.h> @@ -46,13 +47,14 @@ extern "C" { #error "Target CPU not supported." #endif -#define I(dom, e) ((e) ? (void)0 : \ - (dom)->srv->fatal(#e, __FILE__, __LINE__)) -#define W(dom, e, s) ((e) ? (void)0 : \ - (dom)->srv->warning(#e " : " #s, __FILE__, __LINE__)) +#define I(dom, e) ((e) ? (void)0 : \ + (dom)->srv->fatal(#e, __FILE__, __LINE__, "")) -#define A(dom, e, s) ((e) ? (void)0 : \ - (dom)->srv->fatal(#e " : " #s, __FILE__, __LINE__)) +#define W(dom, e, s, ...) ((e) ? (void)0 : \ + (dom)->srv->warning(#e, __FILE__, __LINE__, s, ## __VA_ARGS__)) + +#define A(dom, e, s, ...) ((e) ? (void)0 : \ + (dom)->srv->fatal(#e, __FILE__, __LINE__, s, ## __VA_ARGS__)) struct rust_task; struct rust_port; @@ -164,7 +166,7 @@ template <typename T> inline T check_null(rust_dom *dom, T value, char const *expr, char const *file, size_t line) { if (value == NULL) { - dom->srv->fatal(expr, file, line); + dom->srv->fatal(expr, file, line, "is null"); } return value; } |