In C++, I need to defined a macro. That macro would take as parameter a \"block\" of code.
Can we safely use several lines of code as parameter of a macro fu
the way to make it work (at least for gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu9)), is to use braces { } enclosing your actuals for the macro.
A useful example:
#ifdef DEBUG
#define MYDEBUG(X) (X)
#else
#define MYDEBUG(X)
#endif
MYDEBUG({
if (shit_happens) {
cerr << "help!" << endl;
....
}
});