From 53681cbdb64fbd4a4dc18be76781c94a468a6042 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Mon, 5 Sep 2005 15:16:10 +0000 Subject: * use own assertions which should get logged properly --HG-- extra : convert_revision : 3dc365619f0840ab5781660b1257a9f22c05d3fe --- dbutil.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'dbutil.h') diff --git a/dbutil.h b/dbutil.h index d904949..eef75e3 100644 --- a/dbutil.h +++ b/dbutil.h @@ -39,6 +39,7 @@ extern void (*_dropbear_log)(int priority, const char* format, va_list param); void dropbear_exit(const char* format, ...); void dropbear_close(const char* format, ...); void dropbear_log(int priority, const char* format, ...); +void fail_assert(const char* expr, const char* file, int line); #ifdef DEBUG_TRACE void dropbear_trace(const char* format, ...); void printhex(const char * label, const unsigned char * buf, int len); @@ -66,4 +67,7 @@ void setnonblocking(int fd); /* Used to force mp_ints to be initialised */ #define DEF_MP_INT(X) mp_int X = {0, 0, 0, NULL} +/* Dropbear assertion */ +#define dropbear_assert(X) do { if (!(X)) { fail_assert(#X, __FILE__, __LINE__); } } while (0) + #endif /* _DBUTIL_H_ */ -- cgit v1.2.3