I have the following lines of code created by the database export program:
typedef struct _s8_VARB
{
unsigned char _byte[8];
} s8_VARB;
const s8_VARB varb00[] = {
mMM(1,25,22,12,0,0,0,0,27)
mMM(0,1,29,12,0,0,0,0,21)
mMM(1,1,36,12,0,0,0,0,22)
}
mMM is a macro that I want to define using a function that will produce the following data at compile time:
const s8_VARB varb00[] = {
1,25,22,12,0,0,0,0,27,
1,1,36,12,0,0,0,0,22,
}
So basically he has to check the 1st parameter. If it is 0, this complete line should be omitted. If it is equal to 1, all parameters (except the 1st) should be "placed in a line" ending with a comma.
I tried this:
But that does not work. Even compilation as gcc complains:
error: expected expression before ':' token
What should this macro definition look like? Is this even possible in C?