Boost C++ Libraries: Ticket #1766: Wrong evaluation of conditional preprocessor directives with predefined macros __FILE__, __LINE__ and __INCLUDE_LEVEL__ https://svn.boost.org/trac10/ticket/1766 <p> Checking whether one of the predefined macros <code>__LINE__, __FILE__ and __INCLUDE_LEVEL__</code> exists is not possible, wave always returns false when one of these macros is checked with the defined() operator or the #ifdef directive for example. </p> <p> For example this code will trigger the error even though <code>__LINE__</code> is defined. </p> <pre class="wiki">#ifndef __LINE__ #error "no __LINE__" #endif </pre><p> I had a look at the source and think it can be fixed in cpp_macromap.hpp: There are three overloads for macromap&lt;&gt;::is_defined(), but only one checks for the special case of those three predefined macros. If the other overloads call the working one, the problem seems gone. </p> <p> However, i have no experience with the wave source and just started having a look at it today, thats why i have no idea if there aren't any side-effects with this 'fix' and I'm looking for an official fix or a reply on this case. I have attached my .patch though. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1766 Trac 1.4.3 anonymous Thu, 03 Apr 2008 23:06:12 GMT attachment set https://svn.boost.org/trac10/ticket/1766 https://svn.boost.org/trac10/ticket/1766 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">wave_predefined.patch</span> </li> </ul> <p> patch that maybe solves the problem </p> Ticket Hartmut Kaiser Fri, 04 Apr 2008 01:48:25 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1766#comment:1 https://svn.boost.org/trac10/ticket/1766#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Thanks for the patch! I applied it to the trunk. </p> <p> Regards Hartmut </p> Ticket Hartmut Kaiser Fri, 04 Apr 2008 02:01:32 GMT <link>https://svn.boost.org/trac10/ticket/1766#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1766#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/1766#comment:1" title="Comment 1">hkaiser</a>: </p> <blockquote class="citation"> <p> Thanks for the patch! I applied it to the trunk. </p> </blockquote> <p> Additionally I added a new test checking for this regression. </p> <p> Regards Hartmut </p> </description> <category>Ticket</category> </item> </channel> </rss>