I have a situation where I have quite a few generated functions, and would like to point them at some generic functions that I have created (to allow me to reuse the base co
You need to provide an extra level of "function-like macro" to ensure the proper expansion:
e.g.
#define SIGNAL1 SignalName1
#define SIGNAL2 SignalName2
#define MAKE_FN_NAME(x) void Callback_ ## x (void)
#define FUNCTION_NAME(signal) MAKE_FN_NAME(signal)
FUNCTION_NAME(SIGNAL1)
{
return;
}
output:
$ gcc -E prepro.cc
# 1 "prepro.cc"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "prepro.cc"
void Callback_SignalName1 (void)
{
return;
}