Boost logo

Boost :

From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2004-12-06 08:16:05


Stefan Slapeta wrote:

> b)
>
> thread/detail/config.hpp:
>
> # if defined(BOOST_MSVC) || defined(BOOST_INTEL_WIN)
> //For VC++, choose according to threading library setting
> # if defined(_DLL)
> //Threading library is dll: use Boost.Threads dll
> # define BOOST_THREAD_USE_DLL
> # define BOOST_THREAD_DECL __declspec(dllimport)
> # define BOOST_DYN_LINK
> # else
> //Threading library is lib: used Boost.Threads lib
> # define BOOST_THREAD_USE_LIB
> # define BOOST_THREAD_DECL
> # endif
> # else
>
> IMO this sequence is wrong (look at the comments!) because the _DLL
> macro _DOESN'T_ say that a dll is built!!!! It rather says that a
> shared runtime is used (I don't know if this was the intention behind
> this sequence, the comment is wrong anyway).
> The code as is means that every static rt configuration is linked to a
> static boost.thread lib and every dynamic rt configuration is linked
> to boost.thread as dll. I just don't know if there is any rationale
> behind automatically selecting these combinations.
>
I think the problem is of how to deduce how the boost libs should be
linked in when the user does not explicitely
specifiy e.g. BOOST_USE_LIB.
A reasonable default in this case would be then to link in the library
corresponding to the RTL choice.
The code snippet refers to the default choice doesn't it?
# else //Use default
The comment
            //For VC++, choose according to threading library setting
should better read
            //For VC++, choose according to C-runtime library setting
of course.

Does this make sense?

Roland


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