diff options
Diffstat (limited to 'lib/common/DebugAssertFailed.cpp')
-rwxr-xr-x | lib/common/DebugAssertFailed.cpp | 32 |
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 + |