#define DEBUG... (using printf for debugging)

mdivax1!robinson mdivax1!robinson
Wed May 9 04:32:11 AEST 1990


In article <801 at oz.rci.dk> kc at oz.rci.dk (Knud Christensen) writes:
>The following, which i found in a magazine solves the problem very elegantly i
>think:
>
>/*
>  debug.h
>
>  This header file gives a number of usefull definitions for debugging
>*/
>
>#ifdef debug
>#  define DFPRINTF(x) fprintf x
>#  define DTRACE fprintf(stderr, "Trace line %d\n", __LINE__)
>#  define DTRINT(var) fprintf(stderr, "Trace line %d var = %d\n", __LINE__, var)
>#else
>#  define DFPRINTF(x)
>#  define DTRACE
>#  define DTRINT(var)
>#endif
>
>/*
>  End of debug facility definitions
>*/

Isn't the use of __LINE__ non-portable?
-- 
Jim Robinson
{uunet,ubc-cs}!van-bc!mdivax1!robinson



More information about the Alt.sources mailing list