summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphintuka <phintuka>2006-10-23 19:22:14 +0000
committerphintuka <phintuka>2006-10-23 19:22:14 +0000
commit2aedaabd2dfc87ae2eec2f42100bb66699b6877d (patch)
tree400d6c6c99d971deab99a83b99e096183eb0e9bc
parent6f14e223c0a299fb824165255e2a1e4cb2164ac6 (diff)
downloadxineliboutput-2aedaabd2dfc87ae2eec2f42100bb66699b6877d.tar.gz
xineliboutput-2aedaabd2dfc87ae2eec2f42100bb66699b6877d.tar.bz2
ASSERT
-rw-r--r--logdefs.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/logdefs.h b/logdefs.h
index 28e754b3..1cdcb501 100644
--- a/logdefs.h
+++ b/logdefs.h
@@ -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
#