Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2007-11-29 04:11:50

John Maddock <john <at>> writes:

> Anthony Williams wrote:
> > Since the boost thread headers can now be used without including
> > <windows.h>, can I commit the following patch to
> > boost/config/suffix.hpp in order to stop BOOST_DISABLE_THREADS being
> > defined just because the user specified /Za on the command line?
> >
> > There was a discussion about this back in May, but I don't remember
> > there being a definite outcome.
> That would almost certainly break Regex and maybe other libraries as well
Why? The only uses of BOOST_DISABLE_THREADS that I can see are in the smart_ptr
detail headers and in xpressive. In neither case will the code break if this is
not defined on a multi-threaded build, but /Za is specified.

There's more uses of BOOST_HAS_THREADS, but looking at them (including those in
the regex headers), it seems to me that BOOST_HAS_THREADS really ought to be
defined for a multi-threaded build, even if /Za is specified, otherwise the code
won't be thread-safe.

Code that depends on <windows.h> will break if /Za is specified, but that's a
separate issue to BOOST_DISABLE_THREADS. I'm not suggesting we should be able to
*build* boost with /Za, just use it.
> I would prefer not to make this change to Boost.Config for 1.35, but we
> should try to find a decent way of handling this.

I was thinking that we didn't fix this in 1.34, so we ought to try and fix it in


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