summaryrefslogtreecommitdiffstats
path: root/unwind.h
diff options
context:
space:
mode:
Diffstat (limited to 'unwind.h')
-rw-r--r--unwind.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/unwind.h b/unwind.h
index 6f7683a8..00931429 100644
--- a/unwind.h
+++ b/unwind.h
@@ -79,17 +79,15 @@ obj_t *uw_set_func(obj_t *sym, obj_t *value);
obj_t *uw_block_return(obj_t *tag, obj_t *result);
void uw_push_catch(uw_frame_t *, obj_t *matches);
noreturn obj_t *uw_throw(obj_t *sym, obj_t *exception);
-noreturn obj_t *uw_throwf(obj_t *sym, const wchar_t *fmt, ...);
-noreturn obj_t *uw_errorf(const wchar_t *fmt, ...);
-noreturn obj_t *uw_throwcf(obj_t *sym, const wchar_t *fmt, ...);
-noreturn obj_t *uw_errorcf(const wchar_t *fmt, ...);
+noreturn obj_t *uw_throwf(obj_t *sym, obj_t *fmt, ...);
+noreturn obj_t *uw_errorf(obj_t *fmt, ...);
obj_t *uw_register_subtype(obj_t *sub, obj_t *super);
obj_t *uw_exception_subtype_p(obj_t *sub, obj_t *sup);
void uw_continue(uw_frame_t *curr, uw_frame_t *target);
void uw_pop_frame(uw_frame_t *);
void uw_init(void);
-noreturn obj_t *type_mismatch(const wchar_t *, ...);
+noreturn obj_t *type_mismatch(obj_t *, ...);
#define uw_block_begin(TAG, RESULTVAR) \
obj_t *RESULTVAR = nil; \
@@ -149,9 +147,14 @@ noreturn obj_t *type_mismatch(const wchar_t *, ...);
}
#define internal_error(STR) \
- uw_throwcf(internal_err, \
- L"%s:%d %ls", __FILE__, \
- __LINE__, STR)
+ do { \
+ extern obj_t *num(long); \
+ uw_throwf(internal_err, \
+ lit("~a:~a ~a"), \
+ lit(__FILE__), \
+ num(__LINE__), lit(STR), \
+ nao); \
+ } while (0)
#define type_assert(EXPR, ARGS) \
if (!(EXPR)) type_mismatch ARGS
@@ -164,12 +167,13 @@ noreturn obj_t *type_mismatch(const wchar_t *, ...);
#define numeric_assert(EXPR) \
if (!(EXPR)) \
- uw_throwcf(numeric_err, L"%ls", \
- L"assertion " #EXPR \
- L" failed")
+ uw_throwf(numeric_err, \
+ lit("assertion " #EXPR \
+ "failed"), nao)
#define range_bug_unless(EXPR) \
if (!(EXPR)) \
- uw_throwcf(range_err, L"%ls", \
- L"assertion" #EXPR \
- L" failed")
+ uw_throwf(range_err, \
+ lit("assertion " #EXPR \
+ "failed"), nao)
+