Boost logo

Boost :

From: (noreply_at_[hidden])
Date: 2007-01-03 18:25:26

Patches item #1627420, was opened at 2007-01-03 15:17
Message generated for change (Comment added) made by sohail_
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: sohail (sohail_)
Assigned to: Nobody/Anonymous (nobody)
Summary: [thread] MSVS: Allow use of thread headers with /Za

Initial Comment:
The following code will not compile if built with /Za on Visual C++ 7.1+:

#include <boost/thread/once.hpp>

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 => language extensions are not necessary => 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:


#include <boost/config.hpp>

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.




>Comment By: sohail (sohail_)
Date: 2007-01-03 15:25

Logged In: YES
Originator: YES

That should be:




You can respond by visiting:

Take Surveys. Earn Cash. Influence the Future of IT
Join's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
Boost-bugs mailing list

Boost list run by bdawes at, gregod at, cpdaniel at, john at