I was able to do it slightly different way by #define default values and then declaring/defining the functions to get each of the params with a common macro.
#ifndef PARAM_ALPHA
#define PARAM_ALPHA (20)
#endif
#ifndef PARAM_BETA
#define PARAM_BETA (19)
#endif
#define DEFINE_ACCESSOR(name,macro_name) \
static inline unsigned int get\_##name(){return macro_name;}
#define PARAM_LIST(X) \
X(ALPHA,PARAM_ALPHA) \\
X(BETA,PARAM_BETA)
PARAM_LIST(DEFINE_ACCESSOR)
int main()
{
printf("\nAlpha: %d\n", get_ALPHA());
printf("\nBeta: %d\n", get_BETA());
}
I noticed compiler burps if I use "ifdef <something>" inside the inline C code.
So if I pass in -DPARAM_ALPHA=10 during compile time, thats the value I get. Otherwise I get default value of 20.