T
thomas
Hi,
I'm stucked by something appears really simple at first sight.
I have a function definition with different parameter list in different compile configurations. for example.
--------------------------
CONF1:
int f(int x, int y){}
int g(int x){}
CONF2:
int f(int y){}
int g(){}
----------------------------
I'm trying to define some marco like
#if CONF1
#define PARAM(list) int x, list
#elseif CONF2
#define PARAM(list) list
#endif
But it cannot work for func g() definition in CONF1 since a "," is appended unexpectedly.
It seems to be really simple, but I am now a little dumb how to define one and solve it elegantly.
thanks.
tom
I'm stucked by something appears really simple at first sight.
I have a function definition with different parameter list in different compile configurations. for example.
--------------------------
CONF1:
int f(int x, int y){}
int g(int x){}
CONF2:
int f(int y){}
int g(){}
----------------------------
I'm trying to define some marco like
#if CONF1
#define PARAM(list) int x, list
#elseif CONF2
#define PARAM(list) list
#endif
But it cannot work for func g() definition in CONF1 since a "," is appended unexpectedly.
It seems to be really simple, but I am now a little dumb how to define one and solve it elegantly.
thanks.
tom