Greetings!

I have a long macro expansion in which I have used backslash/newline
sequences to make the definition readable. As I am debugging, I want
to see what the preprocessor has done, so I throw a /P into my compiler
arguments to get a .i preprocessor output file. Inside the .i file, I
see that the macro has been expanded onto a single line. This is, of
course, perfectly reasonable C++, but I'd like to have the newlines in
the expansion so that I can see it more easily. Is there a way to tell
the preprocessor to keep the newlines in the expansion?

Thanks very much!

Rob Richardson
RAD-CON, Inc.

Re: Is there a way to keep newlines in preprocessor macro expansions? by Carl

Carl
Mon Sep 25 09:36:33 CDT 2006

CedricCicada@gmail.com wrote:
> Greetings!
>
> I have a long macro expansion in which I have used backslash/newline
> sequences to make the definition readable. As I am debugging, I want
> to see what the preprocessor has done, so I throw a /P into my
> compiler arguments to get a .i preprocessor output file. Inside the
> .i file, I see that the macro has been expanded onto a single line.
> This is, of course, perfectly reasonable C++, but I'd like to have
> the newlines in the expansion so that I can see it more easily. Is
> there a way to tell the preprocessor to keep the newlines in the
> expansion?

No, there isn't.

-cd



Re: Is there a way to keep newlines in preprocessor macro expansions? by Brian

Brian
Mon Sep 25 11:35:07 CDT 2006

To add to Carl's response, I suggest you consider using an inline subroutine
instead. They are every bit as efficient as macros, and definitely much more
readable.

Brian