How to write a macro which calls goto END_ label?
For ex:
#define MY_MACRO() \
//How to define goto END_##function_name label??
my_function()
{
MY_MACRO();
END_my_function:
return;
}
The MY_MACRO should simply replace with the line
goto END_my_function;
I don’t think it can be done. Even though some compilers define
__FUNCTION__or__func__, these are not expanded in macros.However, note that you don’t need a separate label for each function: you can use
ENDfor all functions and simply writegoto END.