On 04/07/20 21:44, BALATON Zoltan wrote: > > No it's OK, no need to list all defines. I just did not notice the macro > argument that's why I was wondering where it comes from. This seems to > be used elsewhere at least here: > > hw/audio/es1370.c:#define a(n) if (val & CTRL_##n) strcat (buf, " "#n) > hw/audio/es1370.c:#define a(n) if (val & SCTRL_##n) strcat (buf, " "#n) > hw/audio/es1370.c:#define b(n) if (!(val & SCTRL_##n)) strcat (buf, " "#n) > > Maybe writing it without the space between "# is clearer as then it > looks more like it's part of the value.
I think keeping the space is better. The reason is that CTRL_##n pastes together CTRL_ and n, but " "#n is different: 1) First, it turns n into a string, for example "1" 2) Then, just because there is another string just before, the two are concatenated, as in "CTRL_" "1". Paolo