Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66106 - in trunk/libs/serialization: build example src test vc7ide
From: ramey_at_[hidden]
Date: 2010-10-19 15:43:16


Author: ramey
Date: 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
New Revision: 66106
URL: http://svn.boost.org/trac/boost/changeset/66106

Log:
fix compatibility with archive versions 1.41-, 1.42, 1.43,1.44+
Properties modified:
   trunk/libs/serialization/example/ (props changed)
Text files modified:
   trunk/libs/serialization/build/Jamfile.v2 | 2 ++
   trunk/libs/serialization/example/demo_auto_ptr.cpp | 10 +++++-----
   trunk/libs/serialization/example/log_archive.hpp | 2 +-
   trunk/libs/serialization/example/portable_binary_iarchive.hpp | 2 +-
   trunk/libs/serialization/example/simple_log_archive.hpp | 8 ++++----
   trunk/libs/serialization/src/basic_iarchive.cpp | 3 +++
   trunk/libs/serialization/src/basic_oarchive.cpp | 3 +++
   trunk/libs/serialization/src/basic_serializer_map.cpp | 4 ++++
   trunk/libs/serialization/src/shared_ptr_helper.cpp | 3 +++
   trunk/libs/serialization/src/xml_archive_exception.cpp | 2 +-
   trunk/libs/serialization/test/test_list_ptrs.cpp | 2 +-
   trunk/libs/serialization/test/test_utf8_codecvt.cpp | 2 +-
   trunk/libs/serialization/test/test_vector.cpp | 4 ++--
   trunk/libs/serialization/test/test_void_cast.cpp | 2 +-
   trunk/libs/serialization/vc7ide/demo_xml.vcproj | 3 ++-
   trunk/libs/serialization/vc7ide/test_simple_class.vcproj | 2 +-
   trunk/libs/serialization/vc7ide/test_variant.vcproj | 3 +++
   17 files changed, 38 insertions(+), 19 deletions(-)

Modified: trunk/libs/serialization/build/Jamfile.v2
==============================================================================
--- trunk/libs/serialization/build/Jamfile.v2 (original)
+++ trunk/libs/serialization/build/Jamfile.v2 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -100,6 +100,7 @@
     : $(SOURCES).cpp
     :
     <toolset>msvc:<cxxflags>/Gy
+ <toolset>gcc:<cxxflags>"-fvisibility=hidden"
     <link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
     ;
 
@@ -107,6 +108,7 @@
     : $(WSOURCES).cpp boost_serialization
     :
     <toolset>msvc:<cxxflags>/Gy
+ <toolset>gcc:<cxxflags>"-fvisibility=hidden"
     <link>shared:<define>BOOST_SERIALIZATION_DYN_LINK=1
     ;
 

Modified: trunk/libs/serialization/example/demo_auto_ptr.cpp
==============================================================================
--- trunk/libs/serialization/example/demo_auto_ptr.cpp (original)
+++ trunk/libs/serialization/example/demo_auto_ptr.cpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -29,13 +29,13 @@
 namespace serialization {
 
 /////////////////////////////////////////////////////////////
-// implement serialization for auto_ptr<T>
+// implement serialization for auto_ptr< T >
 // note: this must be added to the boost namespace in order to
 // be called by the library
 template<class Archive, class T>
 inline void save(
     Archive & ar,
- const std::auto_ptr<T> &t,
+ const std::auto_ptr< T > &t,
     const unsigned int file_version
 ){
     // only the raw pointer has to be saved
@@ -47,7 +47,7 @@
 template<class Archive, class T>
 inline void load(
     Archive & ar,
- std::auto_ptr<T> &t,
+ std::auto_ptr< T > &t,
     const unsigned int file_version
 ){
     T *pTarget;
@@ -55,7 +55,7 @@
     // note that the reset automagically maintains the reference count
     #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
         t.release();
- t = std::auto_ptr<T>(pTarget);
+ t = std::auto_ptr< T >(pTarget);
     #else
         t.reset(pTarget);
     #endif
@@ -66,7 +66,7 @@
 template<class Archive, class T>
 inline void serialize(
     Archive & ar,
- std::auto_ptr<T> &t,
+ std::auto_ptr< T > &t,
     const unsigned int file_version
 ){
     boost::serialization::split_free(ar, t, file_version);

Modified: trunk/libs/serialization/example/log_archive.hpp
==============================================================================
--- trunk/libs/serialization/example/log_archive.hpp (original)
+++ trunk/libs/serialization/example/log_archive.hpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -48,7 +48,7 @@
         base::save_override(boost::serialization::make_nvp(NULL, t), 0);
     }
     template<class T>
- void save_override(const boost::serialization::nvp<T> & 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);

Modified: trunk/libs/serialization/example/portable_binary_iarchive.hpp
==============================================================================
--- trunk/libs/serialization/example/portable_binary_iarchive.hpp (original)
+++ trunk/libs/serialization/example/portable_binary_iarchive.hpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -105,7 +105,7 @@
         boost::intmax_t l;
         load_impl(l, sizeof(T));
         // use cast to avoid compile time warning
- //t = static_cast<T>(l);
+ //t = static_cast< T >(l);
         t = T(l);
     }
     void load(boost::serialization::item_version_type & t){

Modified: trunk/libs/serialization/example/simple_log_archive.hpp
==============================================================================
--- trunk/libs/serialization/example/simple_log_archive.hpp (original)
+++ trunk/libs/serialization/example/simple_log_archive.hpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -67,20 +67,20 @@
             boost::serialization::serialize_adl(
                 ar,
                 const_cast<T &>(t),
- ::boost::serialization::version<T>::value
+ ::boost::serialization::version< T >::value
             );
         }
     };
     template<class T>
     void save(const T &t){
         typedef
- BOOST_DEDUCED_TYPENAME boost::mpl::eval_if<boost::is_enum<T>,
+ BOOST_DEDUCED_TYPENAME boost::mpl::eval_if<boost::is_enum< T >,
                 boost::mpl::identity<save_enum_type<simple_log_archive> >,
             //else
             BOOST_DEDUCED_TYPENAME boost::mpl::eval_if<
                 // if its primitive
                     boost::mpl::equal_to<
- boost::serialization::implementation_level<T>,
+ boost::serialization::implementation_level< T >,
                         boost::mpl::int_<boost::serialization::primitive_type>
>,
                     boost::mpl::identity<save_primitive<simple_log_archive> >,
@@ -139,7 +139,7 @@
         );
     }
     template<class T>
- simple_log_archive & operator<<(const boost::serialization::nvp<T> & 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)

Modified: trunk/libs/serialization/src/basic_iarchive.cpp
==============================================================================
--- trunk/libs/serialization/src/basic_iarchive.cpp (original)
+++ trunk/libs/serialization/src/basic_iarchive.cpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -29,6 +29,9 @@
 #include <boost/serialization/tracking.hpp>
 
 #define BOOST_ARCHIVE_SOURCE
+// include this to prevent linker errors when the
+// same modules are marked export and import.
+#define BOOST_SERIALIZATION_SOURCE
 
 #include <boost/archive/archive_exception.hpp>
 

Modified: trunk/libs/serialization/src/basic_oarchive.cpp
==============================================================================
--- trunk/libs/serialization/src/basic_oarchive.cpp (original)
+++ trunk/libs/serialization/src/basic_oarchive.cpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -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 <boost/archive/detail/decl.hpp>
 #include <boost/archive/basic_archive.hpp>

Modified: trunk/libs/serialization/src/basic_serializer_map.cpp
==============================================================================
--- trunk/libs/serialization/src/basic_serializer_map.cpp (original)
+++ trunk/libs/serialization/src/basic_serializer_map.cpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -16,6 +16,10 @@
 #include <utility>
 
 #define BOOST_ARCHIVE_SOURCE
+// include this to prevent linker errors when the
+// same modules are marked export and import.
+#define BOOST_SERIALIZATION_SOURCE
+
 #include <boost/archive/archive_exception.hpp>
 #include <boost/serialization/throw_exception.hpp>
 

Modified: trunk/libs/serialization/src/shared_ptr_helper.cpp
==============================================================================
--- trunk/libs/serialization/src/shared_ptr_helper.cpp (original)
+++ trunk/libs/serialization/src/shared_ptr_helper.cpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -19,6 +19,9 @@
 #include <cstddef> // 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 <boost/serialization/throw_exception.hpp>
 #include <boost/serialization/void_cast.hpp>

Modified: trunk/libs/serialization/src/xml_archive_exception.cpp
==============================================================================
--- trunk/libs/serialization/src/xml_archive_exception.cpp (original)
+++ trunk/libs/serialization/src/xml_archive_exception.cpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -12,12 +12,12 @@
 # pragma warning (disable : 4786) // too long name, harmless warning
 #endif
 
-#define BOOST_ARCHIVE_SOURCE
 
 #include <exception>
 #include <cassert>
 #include <string>
 
+#define BOOST_ARCHIVE_SOURCE
 #include <boost/archive/xml_archive_exception.hpp>
 
 namespace boost {

Modified: trunk/libs/serialization/test/test_list_ptrs.cpp
==============================================================================
--- trunk/libs/serialization/test/test_list_ptrs.cpp (original)
+++ trunk/libs/serialization/test/test_list_ptrs.cpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -38,7 +38,7 @@
 template<class T>
 struct ptr_equal_to : public std::binary_function<T, T, bool>
 {
- BOOST_STATIC_ASSERT(::boost::is_pointer<T>::value);
+ BOOST_STATIC_ASSERT(::boost::is_pointer< T >::value);
     bool operator()(T const _Left, T const _Right) const
     {
         if(NULL == _Left && NULL == _Right)

Modified: trunk/libs/serialization/test/test_utf8_codecvt.cpp
==============================================================================
--- trunk/libs/serialization/test/test_utf8_codecvt.cpp (original)
+++ trunk/libs/serialization/test/test_utf8_codecvt.cpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -200,7 +200,7 @@
 
     // some libraries have trouble that only shows up with longer strings
     
- wchar_t * test3_data = L"\
+ const wchar_t * test3_data = L"\
     <?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\
     <!DOCTYPE boost_serialization>\
     <boost_serialization signature=\"serialization::archive\" version=\"3\">\

Modified: trunk/libs/serialization/test/test_vector.cpp
==============================================================================
--- trunk/libs/serialization/test/test_vector.cpp (original)
+++ trunk/libs/serialization/test/test_vector.cpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -33,7 +33,7 @@
     BOOST_REQUIRE(NULL != testfile);
 
     // test array of objects
- std::vector<T> avector;
+ std::vector< T > avector;
     avector.push_back(T());
     avector.push_back(T());
     {
@@ -41,7 +41,7 @@
         test_oarchive oa(os, TEST_ARCHIVE_FLAGS);
         oa << boost::serialization::make_nvp("avector", avector);
     }
- std::vector<T> avector1;
+ std::vector< T > avector1;
     {
         test_istream is(testfile, TEST_STREAM_FLAGS);
         test_iarchive ia(is, TEST_ARCHIVE_FLAGS);

Modified: trunk/libs/serialization/test/test_void_cast.cpp
==============================================================================
--- trunk/libs/serialization/test/test_void_cast.cpp (original)
+++ trunk/libs/serialization/test/test_void_cast.cpp 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -36,7 +36,7 @@
 template<class T>
 const boost::serialization::extended_type_info & eti(){
     return boost::serialization::singleton<
- boost::serialization::extended_type_info_typeid<T>
+ boost::serialization::extended_type_info_typeid< T >
>::get_const_instance();
 }
 

Modified: trunk/libs/serialization/vc7ide/demo_xml.vcproj
==============================================================================
--- trunk/libs/serialization/vc7ide/demo_xml.vcproj (original)
+++ trunk/libs/serialization/vc7ide/demo_xml.vcproj 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -73,7 +73,8 @@
                         Name="Debug runtime-dynamic|Win32"
                         OutputDirectory="$(ConfigurationName)"
                         IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1">
+ ConfigurationType="1"
+ CharacterSet="0">
                         <Tool
                                 Name="VCCLCompilerTool"
                                 Optimization="0"

Modified: trunk/libs/serialization/vc7ide/test_simple_class.vcproj
==============================================================================
--- trunk/libs/serialization/vc7ide/test_simple_class.vcproj (original)
+++ trunk/libs/serialization/vc7ide/test_simple_class.vcproj 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -79,7 +79,7 @@
                                 Optimization="2"
                                 ImproveFloatingPointConsistency="TRUE"
                                 AdditionalIncludeDirectories="&quot;$(ProjectDir)..\..\..\&quot;"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_LIB_DIAGNOSTIC=1;BOOST_ALL_DYN_LINK=1;BOOST_ARCHIVE_TEST=text_archive.hpp"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;BOOST_LIB_DIAGNOSTIC=1;BOOST_ALL_DYN_LINK=1;BOOST_ARCHIVE_TEST=binary_archive.hpp"
                                 SmallerTypeCheck="FALSE"
                                 RuntimeLibrary="3"
                                 BufferSecurityCheck="TRUE"

Modified: trunk/libs/serialization/vc7ide/test_variant.vcproj
==============================================================================
--- trunk/libs/serialization/vc7ide/test_variant.vcproj (original)
+++ trunk/libs/serialization/vc7ide/test_variant.vcproj 2010-10-19 15:43:09 EDT (Tue, 19 Oct 2010)
@@ -185,6 +185,9 @@
         </References>
         <Files>
                 <File
+ RelativePath="..\test\A.cpp">
+ </File>
+ <File
                         RelativePath="..\test\test_variant.cpp">
                 </File>
         </Files>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk