Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2007-01-03 18:17:49


Patches item #1627420, was opened at 2007-01-03 15:17
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=307586&aid=1627420&group_id=7586

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:

#if defined(BOOST_BUILDING_WHATEVER)
# define BOOST_NO_REQUIRE_WIN32
#endif

#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.

Thanks,

Sohail

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=307586&aid=1627420&group_id=7586

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk