Is it possible to define a macro so it has the value of the line it is defined on?
I know about __LINE__ but it is expanding too late.
#define MYLINE __LINE__ // line 1
printf("%d\n", MYLINE); // line 2
printf("%d\n", MYLINE); // line 3
The above doesn't do what I want. I would want it to print 1 twice but it instead prints 2 and 3.