I have demostrative code below. I would expect the result will be initialized array.
#define _NAME name
#define CFIT(name)\
{ _NAME },
const char * idns[] = {
CFIT("address")
CFIT("device_id")
CFIT("device_bh")
CFIT("device_hw")
CFIT("device_fw")
"" };
...but preprocesor create this:
const char * idns[] = {
{ name },
{ name },
{ name },
{ name },
{ name },
""
};
Surprisingly the C++ preprocesor works as expected. Replace _NAME macro with 'name' token direcly works as well. Any hints? Using 32b mingw 5.3.0.