diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index 1630713f..a77a8179 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -100,6 +100,7 @@ lib boost_serialization : $(SOURCES).cpp : msvc:/Gy + gcc:"-fvisibility=hidden" shared:BOOST_SERIALIZATION_DYN_LINK=1 ; @@ -107,6 +108,7 @@ lib boost_wserialization : $(WSOURCES).cpp boost_serialization : msvc:/Gy + gcc:"-fvisibility=hidden" shared:BOOST_SERIALIZATION_DYN_LINK=1 ; diff --git a/example/demo_auto_ptr.cpp b/example/demo_auto_ptr.cpp index c430b813..0cca0afe 100644 --- a/example/demo_auto_ptr.cpp +++ b/example/demo_auto_ptr.cpp @@ -29,13 +29,13 @@ namespace boost { namespace serialization { ///////////////////////////////////////////////////////////// -// implement serialization for auto_ptr +// implement serialization for auto_ptr< T > // note: this must be added to the boost namespace in order to // be called by the library template inline void save( Archive & ar, - const std::auto_ptr &t, + const std::auto_ptr< T > &t, const unsigned int file_version ){ // only the raw pointer has to be saved @@ -47,7 +47,7 @@ inline void save( template inline void load( Archive & ar, - std::auto_ptr &t, + std::auto_ptr< T > &t, const unsigned int file_version ){ T *pTarget; @@ -55,7 +55,7 @@ inline void load( // note that the reset automagically maintains the reference count #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1) t.release(); - t = std::auto_ptr(pTarget); + t = std::auto_ptr< T >(pTarget); #else t.reset(pTarget); #endif @@ -66,7 +66,7 @@ inline void load( template inline void serialize( Archive & ar, - std::auto_ptr &t, + std::auto_ptr< T > &t, const unsigned int file_version ){ boost::serialization::split_free(ar, t, file_version); diff --git a/example/log_archive.hpp b/example/log_archive.hpp index d38181ab..6587d0ec 100644 --- a/example/log_archive.hpp +++ b/example/log_archive.hpp @@ -48,7 +48,7 @@ class log_archive : base::save_override(boost::serialization::make_nvp(NULL, t), 0); } template - void save_override(const boost::serialization::nvp & t, int){ + void save_override(const boost::serialization::nvp< T > & t, int){ // this is here to remove the "const" requirement. Since // this class is to be used only for output, it's not required. base::save_override(t, 0); diff --git a/example/portable_binary_iarchive.hpp b/example/portable_binary_iarchive.hpp index 61944f5b..21f7097d 100644 --- a/example/portable_binary_iarchive.hpp +++ b/example/portable_binary_iarchive.hpp @@ -105,7 +105,7 @@ protected: boost::intmax_t l; load_impl(l, sizeof(T)); // use cast to avoid compile time warning - //t = static_cast(l); + //t = static_cast< T >(l); t = T(l); } void load(boost::serialization::item_version_type & t){ diff --git a/example/simple_log_archive.hpp b/example/simple_log_archive.hpp index d7984bce..6ce17d1d 100644 --- a/example/simple_log_archive.hpp +++ b/example/simple_log_archive.hpp @@ -67,20 +67,20 @@ class simple_log_archive { boost::serialization::serialize_adl( ar, const_cast(t), - ::boost::serialization::version::value + ::boost::serialization::version< T >::value ); } }; template void save(const T &t){ typedef - BOOST_DEDUCED_TYPENAME boost::mpl::eval_if, + BOOST_DEDUCED_TYPENAME boost::mpl::eval_if, boost::mpl::identity >, //else BOOST_DEDUCED_TYPENAME boost::mpl::eval_if< // if its primitive boost::mpl::equal_to< - boost::serialization::implementation_level, + boost::serialization::implementation_level< T >, boost::mpl::int_ >, boost::mpl::identity >, @@ -139,7 +139,7 @@ public: ); } template - simple_log_archive & operator<<(const boost::serialization::nvp & t){ + simple_log_archive & operator<<(const boost::serialization::nvp< T > & t){ m_os << '\n'; // start line with each named object // indent according to object depth for(unsigned int i = 0; i < m_depth; ++i) diff --git a/src/basic_iarchive.cpp b/src/basic_iarchive.cpp index a1defa97..29a9a259 100644 --- a/src/basic_iarchive.cpp +++ b/src/basic_iarchive.cpp @@ -29,6 +29,9 @@ namespace std{ #include #define BOOST_ARCHIVE_SOURCE +// include this to prevent linker errors when the +// same modules are marked export and import. +#define BOOST_SERIALIZATION_SOURCE #include diff --git a/src/basic_oarchive.cpp b/src/basic_oarchive.cpp index 7e098874..f3473b9a 100644 --- a/src/basic_oarchive.cpp +++ b/src/basic_oarchive.cpp @@ -21,6 +21,9 @@ // including this here to work around an ICC in intel 7.0 // normally this would be part of basic_oarchive.hpp below. #define BOOST_ARCHIVE_SOURCE +// include this to prevent linker errors when the +// same modules are marked export and import. +#define BOOST_SERIALIZATION_SOURCE #include #include diff --git a/src/basic_serializer_map.cpp b/src/basic_serializer_map.cpp index cf5917f9..c6cfb733 100644 --- a/src/basic_serializer_map.cpp +++ b/src/basic_serializer_map.cpp @@ -16,6 +16,10 @@ #include #define BOOST_ARCHIVE_SOURCE +// include this to prevent linker errors when the +// same modules are marked export and import. +#define BOOST_SERIALIZATION_SOURCE + #include #include diff --git a/src/shared_ptr_helper.cpp b/src/shared_ptr_helper.cpp index ec15e2e2..33c15b78 100644 --- a/src/shared_ptr_helper.cpp +++ b/src/shared_ptr_helper.cpp @@ -19,6 +19,9 @@ #include // NULL #define BOOST_ARCHIVE_SOURCE +// include this to prevent linker errors when the +// same modules are marked export and import. +#define BOOST_SERIALIZATION_SOURCE #include #include diff --git a/src/xml_archive_exception.cpp b/src/xml_archive_exception.cpp index ad16bd9e..f011066e 100644 --- a/src/xml_archive_exception.cpp +++ b/src/xml_archive_exception.cpp @@ -12,12 +12,12 @@ # pragma warning (disable : 4786) // too long name, harmless warning #endif -#define BOOST_ARCHIVE_SOURCE #include #include #include +#define BOOST_ARCHIVE_SOURCE #include namespace boost { diff --git a/test/test_list_ptrs.cpp b/test/test_list_ptrs.cpp index 9a36a39f..644e47e4 100644 --- a/test/test_list_ptrs.cpp +++ b/test/test_list_ptrs.cpp @@ -38,7 +38,7 @@ namespace std{ template struct ptr_equal_to : public std::binary_function { - BOOST_STATIC_ASSERT(::boost::is_pointer::value); + BOOST_STATIC_ASSERT(::boost::is_pointer< T >::value); bool operator()(T const _Left, T const _Right) const { if(NULL == _Left && NULL == _Right) diff --git a/test/test_utf8_codecvt.cpp b/test/test_utf8_codecvt.cpp index fe2b1f81..dd853926 100644 --- a/test/test_utf8_codecvt.cpp +++ b/test/test_utf8_codecvt.cpp @@ -200,7 +200,7 @@ test_main(int /* argc */, char * /* argv */[]) { // some libraries have trouble that only shows up with longer strings - wchar_t * test3_data = L"\ + const wchar_t * test3_data = L"\ \ \ \ diff --git a/test/test_vector.cpp b/test/test_vector.cpp index 59cd9d27..16561a9f 100644 --- a/test/test_vector.cpp +++ b/test/test_vector.cpp @@ -33,7 +33,7 @@ int test_vector(T) BOOST_REQUIRE(NULL != testfile); // test array of objects - std::vector avector; + std::vector< T > avector; avector.push_back(T()); avector.push_back(T()); { @@ -41,7 +41,7 @@ int test_vector(T) test_oarchive oa(os, TEST_ARCHIVE_FLAGS); oa << boost::serialization::make_nvp("avector", avector); } - std::vector avector1; + std::vector< T > avector1; { test_istream is(testfile, TEST_STREAM_FLAGS); test_iarchive ia(is, TEST_ARCHIVE_FLAGS); diff --git a/test/test_void_cast.cpp b/test/test_void_cast.cpp index cb692969..8fdd6d8d 100644 --- a/test/test_void_cast.cpp +++ b/test/test_void_cast.cpp @@ -36,7 +36,7 @@ class MostDerived : public Derived template const boost::serialization::extended_type_info & eti(){ return boost::serialization::singleton< - boost::serialization::extended_type_info_typeid + boost::serialization::extended_type_info_typeid< T > >::get_const_instance(); } diff --git a/vc7ide/demo_xml.vcproj b/vc7ide/demo_xml.vcproj index 3163c4e6..81c34b55 100644 --- a/vc7ide/demo_xml.vcproj +++ b/vc7ide/demo_xml.vcproj @@ -73,7 +73,8 @@ Name="Debug runtime-dynamic|Win32" OutputDirectory="$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" - ConfigurationType="1"> + ConfigurationType="1" + CharacterSet="0"> + +