<div class="gmail_quote">On Wed, Dec 19, 2012 at 3:58 PM, Littlefield, Tyler <span dir="ltr">&lt;<a href="mailto:tyler@tysdomain.com" target="_blank">tyler@tysdomain.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hello all:<br>
I have the following code:<br>
#define REGISTER_MODULE(module)(\<br>
#ifdef BOOST_PP_EQUAL(BOOST_PP_LIST_<u></u>SIZE(MODULES), 0)\<br>
//there are currently no modules in the list.<br>
#define MODULES((module), BOOST_PP_NIL)<br>
#else<br>
BOOST_PP_LIST_APPEND(MODULES, module)\<br>
#endif<br>
)<br>
<br>
I am somewhat of a newb at preprocessor magic, so any advice would be useful. For whatever reason this translates out to &#39;module)&#39; when I try to compile it with -E -P.<br>
The idea is that it will add to the modules list (assuming the modules list exists) the module to be registered, which should just be a type.<br>
Thanks,<span class="HOEnZb"><font color="#888888"></font></span></blockquote><div><br>Someone can correct me here, but I believe you can&#39;t use preprocessor directives (#define, #if, etc.) within a macro definition, and, well, who knows what&#39;ll happen if you try :/<br>
<br>- Jeff<br><br></div></div>