diff options
author | phintuka <phintuka> | 2006-10-23 19:22:14 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2006-10-23 19:22:14 +0000 |
commit | 2aedaabd2dfc87ae2eec2f42100bb66699b6877d (patch) | |
tree | 400d6c6c99d971deab99a83b99e096183eb0e9bc | |
parent | 6f14e223c0a299fb824165255e2a1e4cb2164ac6 (diff) | |
download | xineliboutput-2aedaabd2dfc87ae2eec2f42100bb66699b6877d.tar.gz xineliboutput-2aedaabd2dfc87ae2eec2f42100bb66699b6877d.tar.bz2 |
ASSERT
-rw-r--r-- | logdefs.h | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: logdefs.h,v 1.3 2006-09-06 17:59:34 phintuka Exp $ + * $Id: logdefs.h,v 1.4 2006-10-23 19:22:14 phintuka Exp $ * */ @@ -57,6 +57,21 @@ #define LOGDBG(x...) do{ if(SysLogLevel > 2) x_syslog(LOG_DEBUG, x); } while(0) +#ifdef NDEBUG +# define ASSERT(expr) +#else +# define ASSERT(expr,fatal) \ + do { \ + if(!(expr)) { \ + LOGERR("Asseretion failed: %s at %s:%d (%s)", \ + #expr, __FILE__, __LINE__, __FUNCTION__); \ + if(fatal) \ + abort(); \ + } \ + } while(0) +#endif + + #ifdef XINELIBOUTPUT_DEBUG # ifdef __cplusplus # |