Currently using to show debug output when in debug mode:
#ifdef _DEBUG
#define printX(...) Serial.printf( __VA_ARGS__ )
#else
#define printX(...) NULL
#endif
yet this still include the printX in the result code, and the parameters which have been applied still consume memory, cpu power, and stack size, so my question is:
The macro
#define printX(...) NULL
replaces printX
function call with all its arguments with plain NULL
. This is a textual replacement that happens before a compiler is able to take a look at the code, so any nested calls inside printX
, e.g.
printX(someExpensiveCall())
will also be completely eliminated.