diff options
Diffstat (limited to 'kdbg/mydebug.h')
-rw-r--r-- | kdbg/mydebug.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/kdbg/mydebug.h b/kdbg/mydebug.h new file mode 100644 index 0000000..99f4b58 --- /dev/null +++ b/kdbg/mydebug.h @@ -0,0 +1,25 @@ +/* + * Copyright Johannes Sixt + * This file is licensed under the GNU General Public License Version 2. + * See the file COPYING in the toplevel directory of the source directory. + */ + +#include <kdebug.h> +#include <assert.h> + +#ifdef ASSERT +#undef ASSERT +#endif + +#ifdef NDEBUG +# define ASSERT(x) ((void)0) +#else +# define ASSERT(x) ((x) ? void(0) : void(kdDebug() << \ + (QString("assertion failed: ") + #x).ascii() << "\n")) +#endif + +#ifdef WANT_TRACE_OUTPUT +# define TRACE(x) (kdDebug() << (const char*)(x) << "\n") +#else +# define TRACE(x) ((void)0) +#endif |