Boost C++ Libraries: Ticket #802: [thread] MSVS: Allow use of thread headers with /Za https://svn.boost.org/trac10/ticket/802 <pre class="wiki">The following code will not compile if built with /Za on Visual C++ 7.1+: #include &lt;boost/thread/once.hpp&gt; int main(){} It will fail with the following assertion: # error "Threading support unavaliable: it has been explicitly disabled with BOOST_DISABLE_THREADS" The reason is that the Boost.Config machinery realizes that you cannot use the Windows API unless you enable language extensions. As a result, threads cannot be available. This is correct behaviour when you are indeed *using* the Windows API. However, in the above case where you separately compile the threads library, you do not actually use the Windows API =&gt; language extensions are not necessary =&gt; no need to explicitly specify BOOST_DISABLE_WIN32. I therefore submit that there be some machinery/configuration variables to allow libraries to specify whether or not they require the Windows API. The proposed patch does not modify existing behaviour. That is, if the config machinery decides that the API is needed, it is required, unless explicitly disabled. The code to do this in library xyz would look something like this: #if defined(BOOST_BUILDING_WHATEVER) # define BOOST_NO_REQUIRE_WIN32 #endif #include &lt;boost/config.hpp&gt; I am uncertain of the exact name of the macro that is required but I am certain a macro is required. The attached patch is against 1.33.1. I don't think there is any rush to put this into 1.34. I'm pretty sure it would be nice, but people can manually patch it until 1.35 whenever that is released. Thanks, Sohail </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/802 Trac 1.4.3 sohail_ Wed, 03 Jan 2007 23:25:26 GMT <link>https://svn.boost.org/trac10/ticket/802#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/802#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=1682817 Originator: YES That should be: #if !defined(BOOST_BUILDING_WHATEVER) :) </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>sohail_</dc:creator> <pubDate>Wed, 03 Jan 2007 23:40:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/802#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/802#comment:2</guid> <description> <pre class="wiki">Logged In: YES user_id=1682817 Originator: YES File Added: boost_no_require_win32.patch </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>sohail_</dc:creator> <pubDate>Fri, 05 Jan 2007 20:23:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/802#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/802#comment:3</guid> <description> <pre class="wiki">Logged In: YES user_id=1682817 Originator: YES See also this thread: http://thread.gmane.org/gmane.comp.lib.boost.user/23774/focus=23774 For a discussion that seems to converge on having Boost.Config not touch BOOST_DISABLE_THREADS </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>sohail_</dc:creator> <pubDate>Sat, 06 Jan 2007 03:46:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/802#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/802#comment:4</guid> <description> <pre class="wiki">Logged In: YES user_id=1682817 Originator: YES File Added: 0_boost_building_threads.patch </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Anthony Williams</dc:creator> <pubDate>Tue, 22 May 2007 07:30:47 GMT</pubDate> <title>component changed; severity set https://svn.boost.org/trac10/ticket/802#comment:5 https://svn.boost.org/trac10/ticket/802#comment:5 <ul> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">thread</span> </li> <li><strong>severity</strong> → <span class="trac-field-new">Problem</span> </li> </ul> Ticket viboes Sat, 21 Nov 2009 12:30:18 GMT version changed https://svn.boost.org/trac10/ticket/802#comment:6 https://svn.boost.org/trac10/ticket/802#comment:6 <ul> <li><strong>version</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">Boost 1.34.0</span> </li> </ul> <p> As Boost.Thread has been redesigned since 1.35 shouldn't this ticket be close if the issue do not appears on with the current release? </p> Ticket viboes Wed, 17 Nov 2010 23:08:16 GMT status, resolution changed https://svn.boost.org/trac10/ticket/802#comment:7 https://svn.boost.org/trac10/ticket/802#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-old">None</span> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> As there is no response I close. </p> Ticket