[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gnugo-devel] DEBUG simplification
From: |
Dave Denholm |
Subject: |
Re: [gnugo-devel] DEBUG simplification |
Date: |
05 Dec 2002 10:42:35 +0000 |
Arend Bayer <address@hidden> writes:
> Trevor wrote:
>
> > - simplifies VERBOSE macro definitions
>
>
>
> Hmm, it seems to me we could do
> #define DEBUG(level) (!(verbose & level)) ? (void)0 : (void)gprintf
>
> then use
> DEBUG(DEUB_MOVE_REASONS)("%1m: 0.0 - value already counted", pos)
>
> and do away with the variadic macros. Or is this too ugyl?
>
FWIW, two other ways I have used in the past are
#define DEBUG(level, list) (!(verbose & level)) ? (void)0 : (void)gprintf list
DEBUG(DEBUG_MOVE_REASONS, ("%1m: 0.0 - value already counted", pos))
where the single preproc 'list' variable is bound to the comma-separated
expression ("%1m: 0.0 - value already counted", pos) including the brackets.
or just
#define DEBUG1(level, fmt) ...
#define DEBUG2(level, fmt, arg1) ...
#define DEBUG3(level, fmt, arg1, arg2) ...
and so on
dd
--
address@hidden http://www.insignia.com