01.07.2011, 14:12
Well, I'll give a better example :
What I am trying to do, is to make that compiler would give an error, if you enter the same symbol twice, like:
In this case, function AddSymboll should contain something like:
But function like that wont compile, it gives error. So all I want to know, is it possible to make something like that?
pawn Код:
// Some kind of function:
#define AddSymbol(%0)
// Then use this function
AddSymbol(SYMBOL_ONE);
AddSymbol(SYMBOL_TWO);
AddSymbol(SYMBOL_THREE);
pawn Код:
// Then use this function
AddSymbol(SYMBOL_ONE);
AddSymbol(SYMBOL_TWO);
AddSymbol(SYMBOL_THREE);
AddSymbol(SYMBOL_TWO);
pawn Код:
#define AddSymbol(%0) #if defined SYMBOL_%0 #error Symbol already exists #endif