Boost C++ Libraries: Ticket #6843: [Intel C++] Compile Errors with '#include <atomic>' https://svn.boost.org/trac10/ticket/6843 <p> Under Intel C++ (12.1) on Windows, in C++0x mode, the following fails to compile: </p> <pre class="wiki">#include &lt;atomic&gt; #include &lt;boost/thread.hpp&gt; int main() { } </pre><p> The problem has been discovered previously: </p> <p> <a class="ext-link" href="http://software.intel.com/en-us/forums/showpost.php?p=160114"><span class="icon">​</span>http://software.intel.com/en-us/forums/showpost.php?p=160114</a> </p> <p> However there seems to be no forthcoming fix on Intel's part. </p> <p> Attached is a patch to fix this problem. It will probably require a bit of extra wrapping though (to check for Intel version and C++0x mode). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6843 Trac 1.4.3 Joshua Boyce <raptorfactor@…> Sat, 28 Apr 2012 16:58:43 GMT attachment set https://svn.boost.org/trac10/ticket/6843 https://svn.boost.org/trac10/ticket/6843 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-future-intel-fix-20120421-0519.patch</span> </li> </ul> <p> Fist patch. Massive hack. Needs improvement. </p> Ticket viboes Mon, 28 May 2012 16:05:57 GMT owner, component changed https://svn.boost.org/trac10/ticket/6843#comment:1 https://svn.boost.org/trac10/ticket/6843#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">thread</span> → <span class="trac-field-new">smart_ptr</span> </li> </ul> <p> Hi, </p> <p> I guess this problem is related to Boost.<a class="missing wiki">SmartPtr</a> as the functions atomic_xxx are defined in smart_ptr/shared_ptr.hpp. </p> Ticket Joshua Boyce <raptorfactor@…> Sat, 02 Jun 2012 05:29:35 GMT <link>https://svn.boost.org/trac10/ticket/6843#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6843#comment:2</guid> <description> <p> Right, but doesn't it need to be worked around at the call site (like I've done in my patch)? How would you propose to fix it in shared_ptr at the point where it's declared/defined? I'd love to hear if you have a better way to fix it. </p> <p> Thanks for taking the time to read and respond to the ticket. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Thu, 04 Apr 2013 03:46:54 GMT</pubDate> <title>owner, status, component changed https://svn.boost.org/trac10/ticket/6843#comment:3 https://svn.boost.org/trac10/ticket/6843#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Peter Dimov</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>component</strong> <span class="trac-field-old">smart_ptr</span> → <span class="trac-field-new">thread</span> </li> </ul> <p> An alternative could be to use a file that does the undef of all the concerned macros and another that does the redef. </p> <pre class="wiki">#include &lt;boost/detail/atomic/undef_macros.hpp&gt; if(!atomic_load(&amp;future_)) { future_ptr blank; atomic_compare_exchange(&amp;future_,&amp;blank,future_ptr(new detail::future_object&lt;R&gt;)); } #include &lt;boost/detail/atomic/redef_macros.hpp&gt; </pre><p> This has the advantage to have less noise. The same kind of patch can be applied to <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6842" title="#6842: Patches: [Intel C++] Compile Errors with '#include &lt;atomic&gt;' (closed: wontfix)">#6842</a> </p> Ticket Joshua Boyce <raptorfactor@…> Thu, 04 Apr 2013 07:07:01 GMT <link>https://svn.boost.org/trac10/ticket/6843#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6843#comment:4</guid> <description> <p> Yep, that would work great. Like I said originally, my first patch was a massive hack because I just wanted to get my development unblocked. </p> <p> Your solution looks much nicer, and I look forward to not having to patch my copy locally in the future. :) </p> <p> Thanks for looking into it again. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 07 Apr 2013 22:23:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6843#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6843#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6843#comment:4" title="Comment 4">Joshua Boyce &lt;raptorfactor@…&gt;</a>: </p> <blockquote class="citation"> <p> Yep, that would work great. Like I said originally, my first patch was a massive hack because I just wanted to get my development unblocked. </p> <p> Your solution looks much nicer, and I look forward to not having to patch my copy locally in the future. :) </p> <p> Thanks for looking into it again. </p> </blockquote> <p> It will be too late for 1.54. I will try it very soon. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sun, 14 Apr 2013 21:25:01 GMT</pubDate> <title>milestone changed https://svn.boost.org/trac10/ticket/6843#comment:6 https://svn.boost.org/trac10/ticket/6843#comment:6 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.54.0</span> </li> </ul> <p> Committed revision <a class="changeset" href="https://svn.boost.org/trac10/changeset/83903" title="Detail: Added undef/redef atomic intel macros #6842/#6843.">[83903]</a> including new files. Committed revision 83904 specific thread patch. </p> Ticket viboes Wed, 17 Apr 2013 04:30:51 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6843#comment:7 https://svn.boost.org/trac10/ticket/6843#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/83938" title="Thread: merge from trunk to fix #6843,#6966.">[83938]</a>) Thread: merge from trunk to fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6843" title="#6843: Patches: [Intel C++] Compile Errors with '#include &lt;atomic&gt;' (closed: fixed)">#6843</a>,<a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6966" title="#6966: Bugs: future boost::future_category inconsistent dll linkage (closed: fixed)">#6966</a>. </p> Ticket