sourcepawn
sourcepawn copied to clipboard
too many unexpected loose indentation warnings for marcos
I just don't know why I got loose indentation warnings here. I have some fairly complicated marcos and it generate way too many "loose indentation" warnings when compile even I only space in my code.
I am pretty sure it is caused by if/else block.
If it is not fixable, maybe allow use #pragma
to disable/re-enable certain warning?
#include <sourcemod>
#define __TEST(%1) \
if (%1) { \
PrintToServer("test"); \
} \
if (!(%1)) { \
PrintToServer("!test"); \
} \
PrintToServer("__TEST");
public void Func()
{
bool test = false;
__TEST(test)
}
P.S. If we have inline functions then I could reduce some of my marco :P
The preferred solution here is to use a normal function. This kind of macro is discouraged.