See, you not only have to be a good coder to create a system like Linux, you have to be a sneaky bastard, too.
- Linus Torvalds
#include <stdio.h>
/**
* Define a function.
*
* @param ret Function return value.
* @param name The name of the function.
* @param params List of parameters with surrounding parenthesis.
*/
#define FUNC(ret, name, params) \
ret name params \
{ \
{\
static unsigned int cnt = 0; \
printf("%s [%d]\n",__PRETTY_FUNCTION__,cnt++); \
}
/**
* End function definition.
*/
#define END }
FUNC(int,myfunc,(int param1,int param2,int param3))
int x = 0;
return x++;
END
int main()
{
myfunc(1,2,3);
myfunc(1,2,3);
myfunc(1,2,3);
return 0;
}
myfunc [0] myfunc [1] myfunc [2]