I have a macro:
#define CREATE_COMPONENT(_name, ...) \
typedef struct __VA_ARGS__ _name; \
const int COMPONENT_##_name## = 0;
Such that it can be invoked like:
CREATE_COMPONENT(Position, { float x, y }; )
CREATE_COMPONENT(Scale, { float x, y }; )
Ideally this would create a struct, and an enum entry (I guess) among other things omitted, so I would like COMPONENT_##_enumName##
to increment with each use. I'd end up with (in this case) two values:
COMPONENT_Position = 0;
COMPONENT_Scale = 1;
Again, I sorta just want this to construct an enum, so if there's another way to do something similar without drastically changing the usage of the macro, I'm open to suggestions.