summaryrefslogtreecommitdiff
path: root/lib/common/DebugAssertFailed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common/DebugAssertFailed.cpp')
-rwxr-xr-xlib/common/DebugAssertFailed.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/common/DebugAssertFailed.cpp b/lib/common/DebugAssertFailed.cpp
new file mode 100755
index 00000000..2acf4602
--- /dev/null
+++ b/lib/common/DebugAssertFailed.cpp
@@ -0,0 +1,32 @@
+// --------------------------------------------------------------------------
+//
+// File
+// Name: AssertFailed.cpp
+// Purpose: Assert failure code
+// Created: 2003/09/04
+//
+// --------------------------------------------------------------------------
+
+#ifndef NDEBUG
+
+#include "Box.h"
+
+#include <stdio.h>
+#include <syslog.h>
+
+#include "MemLeakFindOn.h"
+
+bool AssertFailuresToSyslog = false;
+
+void BoxDebugAssertFailed(char *cond, char *file, int line)
+{
+ printf("ASSERT FAILED: [%s] at %s(%d)\n", cond, file, line);
+ if(AssertFailuresToSyslog)
+ {
+ ::syslog(LOG_ERR, "ASSERT FAILED: [%s] at %s(%d)\n", cond, file, line);
+ }
+}
+
+
+#endif // NDEBUG
+