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]

Newline inside macro expansion


Hi all,

This may be simple C preprocessor question. 

I want to write a macro which should have '\n' in its expansion.

e.g. 

#define MAC(a,b) ........

If I call this macro as MAC(param1,param2) its expansion should be
as follows

if(a == param1) 
b = param2;

Hence, I want '\n' (newline character) in macro expansion after if(a ==
param1) .

How can I write macro MAC so as to achieve above functionality.

Thanks,

--Bansidhar


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