aboutsummaryrefslogtreecommitdiff
path: root/src/rt/rust_internal.h
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-08-16 14:13:08 -0700
committerMichael Bebenita <[email protected]>2010-08-16 15:05:57 -0700
commitb40a9fa787dd3b7d979cdf3e156284d6667fe9d2 (patch)
tree27b18e7280feed3adc368a0d98053f84d4fe2215 /src/rt/rust_internal.h
parentAbsent any deep overhauls to syntax or constant-handling, hack in the ability... (diff)
downloadrust-b40a9fa787dd3b7d979cdf3e156284d6667fe9d2.tar.xz
rust-b40a9fa787dd3b7d979cdf3e156284d6667fe9d2.zip
Pulled rust_srv in its own file. Some cleanup, and added varargs to assertion macros.
Diffstat (limited to 'src/rt/rust_internal.h')
-rw-r--r--src/rt/rust_internal.h16
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;
}