diff options
author | Matt Johnston <matt@ucc.asn.au> | 2005-09-05 15:16:10 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2005-09-05 15:16:10 +0000 |
commit | 53681cbdb64fbd4a4dc18be76781c94a468a6042 (patch) | |
tree | b8ae3fd07645b13080425acb2b3b379650ca4ac0 /dbutil.h | |
parent | 5a6404712c54bb3b5746467e6b84baf9d42864b0 (diff) |
* use own assertions which should get logged properly
--HG--
extra : convert_revision : 3dc365619f0840ab5781660b1257a9f22c05d3fe
Diffstat (limited to 'dbutil.h')
-rw-r--r-- | dbutil.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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_ */ |