From fc2f5b2cd655f1391f2abda1b39e37cdec98a951 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Fri, 17 Oct 2003 15:35:43 +0000 Subject: Initial revision --- lib/base/eerror.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 lib/base/eerror.h (limited to 'lib/base/eerror.h') diff --git a/lib/base/eerror.h b/lib/base/eerror.h new file mode 100644 index 00000000..bf913959 --- /dev/null +++ b/lib/base/eerror.h @@ -0,0 +1,43 @@ +#ifndef __E_ERROR__ +#define __E_ERROR__ + +#include "config.h" +#include +#include +#include +#include + +void eFatal(const char* fmt, ...); + +class eString; + +enum { lvlDebug=1, lvlWarning=2, lvlFatal=4 }; + +extern Signal2 logOutput; +extern int logOutputConsole; + +#ifdef ASSERT +#undef ASSERT +#endif + +#ifdef DEBUG + void eDebug(const char* fmt, ...); + void eDebugNoNewLine(const char* fmt, ...); + void eWarning(const char* fmt, ...); + #define ASSERT(x) { if (!(x)) eFatal("%s:%d ASSERTION %s FAILED!", __FILE__, __LINE__, #x); } +#else + inline void eDebug(const char* fmt, ...) + { + } + + inline void eDebugNoNewLine(const char* fmt, ...) + { + } + + inline void eWarning(const char* fmt, ...) + { + } + #define ASSERT(x) do { } while (0) +#endif //DEBUG + +#endif // __E_ERROR__ -- cgit v1.2.3