I want to use a macro in order to easily change a function declaration, here is what I have for now :
#define MYDECLARATION(name) void name (void)
When I call MYDECLARATION(my_thread); I get an error:
identifier-list paramters may only be used in a function definition.
I tried to use ## like that :
#define MYDECLARATION(name) void ##name (void)
but I am pretty sure I will get : voidmythread (void)
in my code. Do you have any idea on how to do it ?
I am also interested if you know some nice tutorials about macros in general.
In response to bitmask comment :
I am using KEIL compiler then my thread are working as follow :
#define MYDECLARATION(name) __task void name(void)
My call :
MYDECLARATION(Mythread);
My definition :
__task void Mythread(void)
{
//...
}
New test :
#define RET_TEST __task void
#define PARAMETER void
RET_TEST MYDECLARATION(PARAMETER);
This is working... So I guess it's the fact to use a macro parameter into a function name which is not working...