Hi Alexander,<br><br>You could use a CompilerInstance to execute an ExpandMacroAction to rewrite the source.<br><br>Cheers,<br><br>Sam Parker<br>Research Student<br>School of Electronic, Electrical and Systems Engineering<br>Loughborough University<br>UK<br><br>Alexander Basov <coopht@gmail.com> wrote:<br><br><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><div dir="ltr">Hello.<div>Could somebody help me with macro expansion?</div><div><br></div><div>I have a header with the following macroses defined:</div><div><br></div><div>#define foo(x) x + 2</div><div>#define A 1</div>
<div>#define B foo(A)</div><div><br></div><div>And I need get the following map:</div><div>A = 1</div><div>B = 3</div><div><br></div><div>How can I do it?</div><div><br></div><div>I'm ale to get list of MacroInfo * classes with PPCallbacks or get it with Preprocessor::macro_begin() iterator, but I don't know how to get expaneded value.</div>
<div><br></div><div>Thank you in advance.</div><div><div><br></div>-- <br>Alexander<br>
</div></div>