Are X macros awkward? I find them very straightforward and clear.
#define E_LIST(X) \
X(V0) X(V1) X(V2) X(V3)
DEFINE_ENUM(E, E_LIST)
That's not how I want to declare my enums...The underlying machinery implementation is going to be much uglier and complex, though.
That looks much nicer indeed, but I still vastly prefer the other solutions, simply because I can just declare regular enums.
#define MY_ENUM(x) x(MY_A) x(MY_B) x(MY_C)
enum my_enum { MY_ENUM(ENUM_ENTRIES) };
static const char *my_enum_names[] = { MY_ENUM(ENUM_NAMES) };
but one could also make it even more compact if one cared.Yes, xmacros have the best compile times, but you can't possibly argue that they are elegant to use compared to the alternatives.
Fair enough.