|
Boost : |
From: Francis ANDRE (francis.andre_at_[hidden])
Date: 2004-11-03 09:07:44
> Except we only have one definition for non_copyable, so what happens if
> library X wants it to have a dll interface and lib Y doesn't? It's also
all
You'r right...so a solution could be to ask to the provider of each dll
boost libraries to embed
each declaration of an imported class with the followings win32 only pragmas
#pragma warning(disable: 4275 4251)
class BOOST_THREAD_DECL mutex
: private noncopyable {
//....
};
#pragma warning(default: 4275 4251)
so that any missing __declspec(dllimport) in any user's dll library could be
trapped as an error!!
Francis
-- A good friend will come bail you out of jail.......... but, a true friend....will be sitting next to you saying: "...that was fun." "John Maddock" <john_at_[hidden]> a écrit dans le message de news:01fe01c4c1a4$fd9e64f0$49f90c52_at_fuji... > > When using the boost.thread package as a dll under vc7.1, one gets for > > each > > reference of boost::mutex the C4275 warning for the inherited noncopyable > > class (in fact 5 times, one for mutex, one for timed_mutex, one for > > try_mutex, one for thread, and one for thread_group!!) > > > > c:\boost\include\boost-1_32\boost\thread\mutex.hpp(34) : warning C4275: > > non - DLL-interface 'boost::noncopyable_::noncopyable' used as base for > > DLL-interface 'boost::mutex' > > > > In order to avoid such warning, it would be nice to redefine -- > > again(sic) -- the BOOST_DECL macro and put it as a decorator for all > > dependent classes used by the boost libraries that could be generated as a > > dll.(thread, regex, filesystem, and so on). > > > > With the empty string as default value in boost/config.hpp, it would the > > responsability of each boost libraries to setup BOOST_DECL to the correct > > value when using it as a dll. > > Except we only have one definition for non_copyable, so what happens if > library X wants it to have a dll interface and lib Y doesn't? It's also all > inline, so declaring it imported is a little strange. Maybe some #pragmas > to disable the warnings would be better, especially as we can't do much > about: > > c:\data\boost\develop\boost\boost\thread\thread.hpp(75) : warning C4251: > 'boost::thread_group::m_threads' : class 'std::list<_Ty>' needs to have > dll-interface to be used by clients of class 'boost::thread_group' > with > [ > _Ty=boost::thread * > ] > > John. > > _______________________________________________ > 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