Boost logo

Boost :

From: Jonathan Wakely (cow_at_[hidden])
Date: 2004-10-06 07:11:57


On Wed, Oct 06, 2004 at 12:36:58PM +0100, John Maddock wrote:

> #ifdef __GLIBCXX__ // gcc 3.4 and greater:
> # ifdef _GLIBCXX_HAVE_GTHR_DEFAULT
> //
> // If the std lib has thread support turned on, then turn it on in
> Boost
> // as well. We do this because some gcc-3.4 std lib headers define
> _REENTANT
> // while others do not...
> //
> # define BOOST_HAS_THREADS
> # else
> # define BOOST_DISABLE_THREADS
> # endif
> #endif

John, this comment (which is in the current version in CVS) is
misleading, and IMHO the whole thing is redundant.

If *any* 3.4 libstdc++ header is included and _GLIBCXX_HAVE_GTHR_DEFAULT
is defined then gthr-default.h will be included and therefore _REENTRANT
will be defined, and therefore BOOST_HAS_THREADS will be defined anyway
by boost/config/suffix.hpp
(this is the case for GCC configured for MT support.)

If _GLIBCXX_HAVE_GTHR_DEFAULT is not defined then gthr-default.h will
not be included, and _REENTRANT will not be defined, and
BOOST_DISABLE_THREADS will be defined by boost/config/suffix.hpp
(this is the case for GCC configured with no support for MT.)

I don't think that bit of preprocessor code changes anything (but I
might be wrong again)

jon

-- 
"It is seldom that liberty of any kind is lost all at once."
	- David Hume

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