Boost C++ Libraries: Ticket #12375: Patch fixing use of boost::icl w/ MSVC CL.exe /P https://svn.boost.org/trac10/ticket/12375 <p> This patch makes it possible to use this header in programs built using the FASTbuild (<a class="ext-link" href="http://fastbuild.org"><span class="icon">​</span>http://fastbuild.org</a>) and more precisely its caching feature. </p> <p> Considering the following code: </p> <p> clmacro.cpp: </p> <pre class="wiki">int main(void) { #define funny_type(x) x funny_type(int)const a = 2; // cl.exe -P clmacro.cpp -&gt; `intconst a` } </pre><p> On MSVC (Visual Studio 2013) Microsoft (R) C/C++ Optimizing Compiler Version 18.00.40629 for x86 Copyright (C) Microsoft Corporation. All rights reserved. </p> <p> This compiles correctly by default with <code>CL.exe</code> </p> <pre class="wiki">Cl.exe clmacro.cpp </pre><p> However when using the <code>/P</code> compilation flag to obtain the pre-processed source, then trying to compile the resulting file this will fail because const gets stitched to the other symbol before compilation. </p> <p> See: </p> <pre class="wiki">cl.exe -P -Ficlmacro.i.cpp clmacro.cpp &amp;&amp; cl.exe clmacro.i.cpp </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12375 Trac 1.4.3 anonymous Wed, 03 Aug 2016 10:52:20 GMT attachment set https://svn.boost.org/trac10/ticket/12375 https://svn.boost.org/trac10/ticket/12375 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">0001-Allow-compilation-on-MSVC-with-P.patch</span> </li> </ul> <p> Patch against boost::icl </p> Ticket anonymous Wed, 03 Aug 2016 10:53:43 GMT <link>https://svn.boost.org/trac10/ticket/12375#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12375#comment:1</guid> <description> <p> The header in question is boost/icl/detail/element_iterator.hpp where the ICL_INTERVAL_TYPE macro is used to create a new const type. The const is glued to the name of the type, which causes problem when using the /P option in CL.exe. </p> <p> So for compatibility it would be appreciated if a space was added. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 03 Aug 2016 10:53:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12375#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12375#comment:1</guid> <description> <p> The header in question is boost/icl/detail/element_iterator.hpp where the ICL_INTERVAL_TYPE macro is used to create a new const type. The const is glued to the name of the type, which causes problem when using the /P option in CL.exe. </p> <p> So for compatibility it would be appreciated if a space was added. </p> </description> <category>Ticket</category> </item> </channel> </rss>