Main Page | Class List | Directories | File List | Class Members | File Members

debug.h File Reference

Collection of debugging macros. More...

#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Defines

#define ERRMSG(msg)   fprintf(stderr, "ERROR: %s, line %d: %s\n", __FILE__, __LINE__, msg)
#define BUG(msg)   do { ERRMSG(msg); abort(); } while (0)
#define ASSERT(expr)
#define COND(expr)
#define ERRCOND(expr)
#define TEXT(t)
#define STR(s)
#define INT(i)
#define PTR(p)
#define FLT(x)
#define VEC(v)


Detailed Description

Collection of debugging macros.

Author:
David J. Hardy
Date:
2003-2005
This file contains a collection of debugging macros. It is intended to be included in C source files only, not in C header files.

The macros ERRMSG() and BUG() are available by simply including this header file. The macros ASSERT(), COND(), and ERRCOND() provide assertion checking that is enabled by defining either DEBUG_SUPPORT or DEBUG_WATCH. Defining DEBUG_WATCH permits the expansion of macros TEXT(), STR(), INT(), PTR(), FLT(), and VEC() that displays quantities. A non-externally linked global integer variable DEBUG_COUNTER is also enabled by defining DEBUG_WATCH. The DEBUG_COUNTER variable is automatically incremented by each of the "watch" macros. It can be useful in the context of debugging loops.


Generated on Mon Sep 26 10:55:18 2005 for MDX by  doxygen 1.4.4