| (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 \ |
| : strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : __FILE__) |
| #define ASSERT(message, body) \ |
| THROW("Assert failed: " message " [" #body "]"); \ |
| typedef void (* handle_t)(intptr_t); |
| extern catch_t g_catch[MAX_CATCH_LEN]; |
| extern unsigned g_catch_len; |
| void throw_(const char *msg, const char *file, unsigned int line); |
| void catch_(handle_t hdl, intptr_t arg); |
| #define THROW(msg) throw_(msg, __FILENAME__, __LINE__) |
| #define CATCH(fn, arg) catch_((handle_t) fn, (intptr_t) arg) |