PDA

View Full Version : Macro doesn't parse enum indexes


Pooh7
10/05/2013, 06:48 PM
Take a look at the following piece of code:


#define dialog:%0(%1,%2,%3,%4) \
forward DIALOG_%0(%1, %2, %3, %4); \
public DIALOG_%0(%1, %2, %3, %4)

enum e_dialog_ids
{
d_abc = 1,
d_def,
d_ghi,
// ...
};

dialog:d_def(playerid, response, listitem, inputtext[])
{
// ...
return 1;
}


The result I expect is creation of a function named "DIALOG_2". Instead, it creates a function "DIALOG_d_def".


How do I make a macro to parse the given parameter as an enum index, not just a string?

Pooh7
11/05/2013, 06:05 PM
bump