Depending on if #define _MODE_1 is set I want to call different versions of a function. At the moment I use
#if defined _MODE_1
myfunction(x,a,n,...);
#else
myfunction(a,n,...);
#endif
The ellipsis carries different arguments at different posions - but within the #if the arguments allways agree (only the x differs). Sometimes there are no arguments in the ellipsis.
I would like to define a macro MyFUNCTION that does the #if such that is does not appear in the the source. something like:
#define MyFUNCTION(X,A,N,ELL) #if defined _MODE_1\
myfunction(X,A,N,ELL)\
#else\
myfunction(A,N,ELL)\
#endif
I'm sorry for such question, but why do you want such a "super-macro"?
You will be necessarily passing spare "x" argument at each place where you call the function? why not make "if...else..." inside the function and make it call two other functions. Obvious profit is that you can use both versions at runtime...