[Dev-C++] #define a "function" with variable number of parameters
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Minds W. <min...@gm...> - 2005-12-18 01:42:13
|
Hi,
I know we can #define "functions" in C/C++, like this :
#define LOG_INFO(msg) if(LOG->isInfoEnabled()) { LOG->info(__FILE__,
__LINE__, msg);}
We use this #define to simplify the LOG code.
But now we change the info method to receive a variable number of parameter=
s
(so the info can used like the printf function), the info signature changed
from:
void info(const* char file, int line, const char* msg);
to:
void info(const* char file, int line, const char* msg, ...);
Is there a way to change the #define LOG_INFO to receive a variable number
of parameters to use the new LOG->info method?
[]s
Freddy
|