[serialization] patches to fix DLL support on Windows

Currently, there are a small collection of bugs in the trunk version of Boost.Serialization that prevent the libraries from compiling as a Windows DLL. Most of these problems relate to missing dllimport/dllexport directives or, in a couple places, to directives that shouldn't be there. Attached are patches to several files to correct these issues. Thanks, -Dave Index: codecvt_null.cpp =================================================================== --- codecvt_null.cpp (revision 39562) +++ codecvt_null.cpp (working copy) @@ -7,6 +7,7 @@ // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +#define BOOST_ARCHIVE_SOURCE #include <boost/archive/codecvt_null.hpp> // codecvt implementation for passing wchar_t objects to char output Index: codecvt_null.hpp =================================================================== --- codecvt_null.hpp (revision 39562) +++ codecvt_null.hpp (working copy) @@ -20,6 +20,7 @@ #include <cstddef> #include <boost/config.hpp> +#include <boost/archive/detail/auto_link_archive.hpp> namespace std{ #if defined(__LIBCOMO__) @@ -58,7 +59,7 @@ template<> class codecvt_null<wchar_t> : public std::codecvt<wchar_t, char, std::mbstate_t> { - virtual std::codecvt_base::result + virtual BOOST_ARCHIVE_DECL(std::codecvt_base::result) do_out( std::mbstate_t & state, const wchar_t * first1, @@ -68,7 +69,7 @@ char * last2, char * & next2 ) const; - virtual std::codecvt_base::result + virtual BOOST_ARCHIVE_DECL(std::codecvt_base::result) do_in( std::mbstate_t & state, const char * first1, Index: interface_iarchive.hpp =================================================================== --- interface_iarchive.hpp (revision 39562) +++ interface_iarchive.hpp (working copy) @@ -32,7 +32,7 @@ namespace archive { namespace detail { -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; +class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; template<class Archive> class interface_iarchive @@ -51,9 +51,9 @@ } template<class T> - const BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer * + const basic_pointer_iserializer * register_type(T * = NULL){ - const BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer & bpis = + const basic_pointer_iserializer & bpis = pointer_iserializer<Archive, T>::get_instance(); this->This()->register_basic_serializer(bpis.get_basic_serializer()); return & bpis; Index: interface_oarchive.hpp =================================================================== --- interface_oarchive.hpp (revision 39562) +++ interface_oarchive.hpp (working copy) @@ -32,7 +32,7 @@ namespace archive { namespace detail { -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; +class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; template<class Archive> class interface_oarchive @@ -51,9 +51,9 @@ } template<class T> - const BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer * + const basic_pointer_oserializer * register_type(const T * = NULL){ - const BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer & bpos = + const basic_pointer_oserializer & bpos = pointer_oserializer<Archive, T>::get_instance(); this->This()->register_basic_serializer(bpos.get_basic_serializer()); return & bpos; Index: basic_oarchive.hpp =================================================================== --- basic_oarchive.hpp (revision 39562) +++ basic_oarchive.hpp (working copy) @@ -71,16 +71,15 @@ public: // note: NOT part of the public interface void register_basic_serializer( - const BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer & bos + const basic_oserializer & bos ); void save_object( const void *x, - const BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer & bos + const basic_oserializer & bos ); void save_pointer( const void * t, - const BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) - basic_pointer_oserializer * bpos_ptr + const basic_pointer_oserializer * bpos_ptr ); void save_null_pointer(){ vsave(NULL_POINTER_TAG);

David Deakins wrote:
Currently, there are a small collection of bugs in the trunk version of Boost.Serialization that prevent the libraries from compiling as a Windows DLL. Most of these problems relate to missing dllimport/dllexport directives or, in a couple places, to directives that shouldn't be there. Attached are patches to several files to correct these issues.
Serialization is currently failing all DLL tests on Windows because of these errors. They may also be at the root of several failures in other libraries. Thus I would appreciate it if the serialization folks would give high priority to applying Dave's patches, or supply other fixes if they prefer a different approach. Thanks, --Beman

Beman Dawes wrote:
David Deakins wrote:
Currently, there are a small collection of bugs in the trunk version of Boost.Serialization that prevent the libraries from compiling as a Windows DLL. Most of these problems relate to missing dllimport/dllexport directives or, in a couple places, to directives that shouldn't be there. Attached are patches to several files to correct these issues.
Serialization is currently failing all DLL tests on Windows because of these errors. They may also be at the root of several failures in other libraries.
Thus I would appreciate it if the serialization folks would give high priority to applying Dave's patches, or supply other fixes if they prefer a different approach.
No reply to a private email to Robert, so I've now applied these patches. --Beman

Sorry, I wanted to do this but I didn't feel comfortable without looking over it detail and running tests here. Unfortunatly, I'm swamped with some other stuff right now and couldn't get to it. Robert Ramey Beman Dawes wrote:
Beman Dawes wrote:
David Deakins wrote:
Currently, there are a small collection of bugs in the trunk version of Boost.Serialization that prevent the libraries from compiling as a Windows DLL. Most of these problems relate to missing dllimport/dllexport directives or, in a couple places, to directives that shouldn't be there. Attached are patches to several files to correct these issues.
Serialization is currently failing all DLL tests on Windows because of these errors. They may also be at the root of several failures in other libraries.
Thus I would appreciate it if the serialization folks would give high priority to applying Dave's patches, or supply other fixes if they prefer a different approach.
No reply to a private email to Robert, so I've now applied these patches.
--Beman _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (3)
-
Beman Dawes
-
David Deakins
-
Robert Ramey