How do I write a cpp macro which expands to include newlines?
Not quite sure what you're asking here. Do you want a macro on multiple lines?
#define NEWLINE_MACRO(x) line1 \
line2 \
line3
Additionally, if you would like to include a literal in your macro:
#define NEWLINE_MACRO(x) ##x
what you you put in x will be put in place of ##x, so:
NEWLINE_MACRO( line1 ) // is replaced with line1
This can be helpful for making custom global functions then just need part of the function name changed.
Also:
#define NEWLINE_MACRO(x) #x // stringify x
Will put quotes around x