Boost logo

Boost :

Subject: Re: [boost] [detail/lightweight_mutex] Win32 threading selection in boost/detail/lightweight_mutex.hpp
From: joaquin_at_[hidden]
Date: 2008-12-18 04:06:03


Peter Dimov escribió:
> joaquin (at) tid es:
>
>> Wouldn't it be better to change the selection code to the following?
>>
>> #elif defined(BOOST_HAS_WINTHREADS)
>> # include <boost/detail/lwm_win32_cs.hpp>
>> #else
>>
>
> This is (I suspect) not done to avoid the old issue with /Za defining
> BOOST_DISABLE_WIN32 defining BOOST_DISABLE_THREADS undefining
> BOOST_HAS_WINTHREADS. On the other hand, in this specific case /Za would
> lead to the (incorrect) selection of lwm_nop and the win32_cs branch would
> never be reached, so it would "work" (that is, fail in the same way). :-)
>

You can have both checks (the extra check for WIN32 et al. is immaterial to
the cygwin/mingw case):

#elif defined(BOOST_HAS_WINTHREADS) ||\
      defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
# include <boost/detail/lwm_win32_cs.hpp>
#else

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


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