J
Josef Angermeier
Hello
I need to write lots of wrapper functions, which look
like that:
wrapper_my_func(int a, int b)
{
my_func(a, b);
<extra_code>
}
Now my problem to express this in a generic way, by using macro.
#define DEF_WRAPPER(ret, func, params...) \
\
ret \
wrapper ## func (params) \
{ \
/* Here the problem, because */ \
func(params); \
\
}
The main problem is to strip off the parameter
types of the arguments for the embedded function call, because
DEF_WRAPPER(void, my_func, int a, int b);
results in
....
wrapper_my_func(...)
{
my_func(int a, in b); <---
....
how to solve that ?
thanks in advance
josef
I need to write lots of wrapper functions, which look
like that:
wrapper_my_func(int a, int b)
{
my_func(a, b);
<extra_code>
}
Now my problem to express this in a generic way, by using macro.
#define DEF_WRAPPER(ret, func, params...) \
\
ret \
wrapper ## func (params) \
{ \
/* Here the problem, because */ \
func(params); \
\
}
The main problem is to strip off the parameter
types of the arguments for the embedded function call, because
DEF_WRAPPER(void, my_func, int a, int b);
results in
....
wrapper_my_func(...)
{
my_func(int a, in b); <---
....
how to solve that ?
thanks in advance
josef