P99
|
◆ P99_SEQ
Apply the macro MACRO to the rest of the argument list. The macro is called with each of the other arguments and the results are separated by commas. Suppose you have an enumeration type with three values: enum { one, two, three } ;
#define ENUM_INIT(X) [X] = P99_STRINGIFY(X)
char const* names[] = { P99_SEQ(ENUM_INIT, one, two, three) };
This will result in the following expansion char const* names[] = { [one] = "one", [two] = "two", [three] = "three" };
|