From b40a9fa787dd3b7d979cdf3e156284d6667fe9d2 Mon Sep 17 00:00:00 2001 From: Michael Bebenita Date: Mon, 16 Aug 2010 14:13:08 -0700 Subject: Pulled rust_srv in its own file. Some cleanup, and added varargs to assertion macros. --- src/rt/rust_internal.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/rt/rust_internal.h') 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 #include #include +#include #include #include @@ -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 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; } -- cgit v1.2.3