[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-dev] Logging code
From: |
John Gilmore |
Subject: |
Re: [Gnash-dev] Logging code |
Date: |
Mon, 07 Aug 2006 13:06:27 -0700 |
> The only problem would be the variable args part.
>
> What would you think about defining macros like:
>
>
> log_msg1()
> log_msg2()
> log_msgN()
Just use double parentheses:
log_msg_if_debugflag(DEB_NOISE, ("%s: %d invalid", p, i));
#define log_msg_if_debugflag(flag,args) if (debugflags & flag) printf args
[You probably want a do-while0 around that to avoid spurious matching of
"else" statements, thus:]
#define log_msg_if_debugflag(flag,args) do { \
if (debugflags & flag) printf args; \
} while (0)
John