<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Apr 10, 2013, at 11:45 PM, huc1985 <<a href="mailto:huc1985@163.com">huc1985@163.com</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hello all.<br>I want to add some objectlike macro to Preprocessor.  I'm using libclang, i<br>want add macro in code. I just know add simple one.<br>e.g.  #define TEST ==>><br>   Preprocessor *pp;<br>   IdentifierInfo *Id = pp->getIdentifierInfo("TEST");<br>   MacroInfo *MI = pp->AllocateMacroInfo(SourceLocation());<br>   MI->setIsBuiltinMacro();<br>   pp->setMacroInfo(Id, MI);<br><br>#define MAX 100<br>How to do next?<br><br></div></blockquote><div><br></div><div>Not sure what you are trying to do, can't you pass a "-D" option to define the macro in the compiler arguments ?</div><br><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><br><br><br>--<br>View this message in context:<span class="Apple-converted-space"> </span><a href="http://clang-developers.42468.n3.nabble.com/how-to-add-objectlike-macro-tp4031430.html">http://clang-developers.42468.n3.nabble.com/how-to-add-objectlike-macro-tp4031430.html</a><br>Sent from the Clang Developers mailing list archive at<span class="Apple-converted-space"> </span><a href="http://nabble.com/">Nabble.com</a>.<br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></div></blockquote></div><br></body></html>