Boost logo

Boost :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2007-09-11 10:24:04


May I bring the post below to the attention of Boost.Config authors, as it
discusses an issue of that library? Basically, is it guaranteed that the
macros BOOST_HAS_PTHREADS and BOOST_HAS_WINTHREADS
are mutually exclusive?

Thank you,

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo

Joaquín Mª López Muñoz ha escrito:

> Joaquín Mª López Muñoz ha escrito:
>
> > Peter Dimov ha escrito:
> >
> > > Joaquín Mª López Muñoz:
> > >
> > > > boost/detail/flyweight_mutex.hpp implements a mutex class based on a
> > > > Win32 CRITICAL_SECTION or using Pthreads according to the
> > > > following pp logic:
> > > >
> > > > #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
> > > > // based on CRITICAL_SECTION
> > > > #elif defined(BOOST_HAS_PTHREADS)
> > > > // based on Pthreads
> > > >
> > > > The problem with this is that WIN32 and related macros are not predefined
> > > > in some environments (Cygwin at least) but rather they are defined inside
> > > > windows.h, thus making the logic above dependent on the inclusion context.
> > >
> > > Would it help if we reverse the two tests?
> >
> > AFAICS, yes. The complementary problem (selecting Pthreads in Win32 when
> > <pthread.h> has been included) seems not to happen when the logic
> > is reversed, at least with pthreads-win32, but further confirmation on this issue
> > would be great.
>
> Another option could be to rely upon BOOST_HAS_PTHREADS and
> BOOST_HAS_WINTHREADS, as it looks like Boost.Config takes extreme
> care to guratnee that they're mutually exclusive. I guess John can shed some light
> on this.
>
> Joaquín M López Muñoz
> Telefónica, Investigación y Desarrollo
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


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