This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Newline inside macro expansion


"Bansidhar Arvind Deshpande  - CTD, Chennai." <bansidhara@ctd.hcltech.com> writes:

> Hi all,
>
> This may be simple C preprocessor question. 
>
> I want to write a macro which should have '\n' in its expansion.

Sorry, this is impossible.  However, in the example you give

> if(a == param1) 
> b = param2;

the C compiler does not care if it appears entirely on one line:

  if (a == param1) b = param2;

so you can just define the macro in the obvious fashion.  If this is
some language other than C, where newlines are significant, you should
use a different preprocessor.  M4 for instance.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]