I need help because what I want, I dont know if it is possible to do it with macros.
It is a macro to allow me to collect stats. Now I do something like:Code:#ifdef ESTADISTICAS # define S(x) (x) #else # define S(x) #endif
But when I want something more complex like:Code:S(++stats.cortes);
It takes me three lines of code. Is there any way to do it in a only one line? like:Code:#ifdef ESTADISTICAS if (cont < 3) ++stats.move_hit[cont]; #endif
Doing this way would allow me a more friendly code and more readable, in a single line, but when I compile I get an error "expected expression berore if".Code:S(if (cont < 3) ++stats.move_hit[cont]);