Ticket #5579: boost-serialization-1_46_1-patch-for-5567_and_5579.patch
File boost-serialization-1_46_1-patch-for-5567_and_5579.patch, 4.1 KB (added by , 11 years ago) |
---|
-
boost/archive/basic_binary_iarchive.hpp
85 85 void load_override(tracking_type & t, int /*version*/){ 86 86 library_version_type lvt = this->get_library_version(); 87 87 if(boost::archive::library_version_type(6) < lvt){ 88 int_least8_tx=0;88 bool x=0; 89 89 * this->This() >> x; 90 90 t = boost::archive::tracking_type(x); 91 91 } 92 92 else{ 93 boolx=0;93 int_least8_t x=0; 94 94 * this->This() >> x; 95 95 t = boost::archive::tracking_type(x); 96 96 } … … 102 102 } 103 103 else 104 104 if(boost::archive::library_version_type(6) < lvt){ 105 int _least16_tx=0;105 int x=0; 106 106 * this->This() >> x; 107 t = boost::archive::class_id_type(x); 107 t = boost::archive::class_id_type(x); 108 108 } 109 109 else{ 110 int x=0;110 int_least16_t x=0; 111 111 * this->This() >> x; 112 112 t = boost::archive::class_id_type(x); 113 113 } … … 183 183 t = boost::serialization::item_version_type(x); 184 184 } 185 185 else{ 186 unsigned int x=0;186 unsigned int x=0; 187 187 * this->This() >> x; 188 188 t = boost::serialization::item_version_type(x); 189 189 } -
libs/serialization/src/basic_iarchive.cpp
96 96 { 97 97 const basic_iserializer * m_bis; 98 98 const class_id_type m_class_id; 99 const bool m_old_type_info; 100 99 101 cobject_type( 100 102 std::size_t class_id, 101 const basic_iserializer & bis 103 const basic_iserializer & bis, 104 bool old_type_info 102 105 ) : 103 106 m_bis(& bis), 104 m_class_id(class_id) 107 m_class_id(class_id), 108 m_old_type_info(old_type_info) 105 109 {} 110 111 106 112 cobject_type(const cobject_type & rhs) : 107 113 m_bis(rhs.m_bis), 108 m_class_id(rhs.m_class_id) 114 m_class_id(rhs.m_class_id), 115 m_old_type_info(rhs.m_old_type_info) 109 116 {} 117 110 118 // the following cannot be defined because of the const 111 119 // member. This will generate a link error if an attempt 112 120 // is made to assign. This should never be necessary 113 121 cobject_type & operator=(const cobject_type & rhs); 122 114 123 bool operator<(const cobject_type &rhs) const 115 124 { 125 // old versions with objects across DLL's depend on not mathcing 126 // since class info will be stored out twice, we must not match in both cases 127 if(m_old_type_info) 128 return &m_bis->get_eti() < &rhs.m_bis->get_eti(); 129 116 130 return *m_bis < *(rhs.m_bis); 117 131 } 118 132 }; … … 289 303 } 290 304 } 291 305 306 const bool boost_archive_ver_5_is_pre_140 = true; 307 292 308 inline class_id_type 293 309 basic_iarchive_impl::register_type( 294 310 const basic_iserializer & bis 295 ){ 311 ) 312 { 313 // if we are serializing in an old archive (before version 5, or version 5 and the user specified that 314 // archive revision 5 is actually 1_39 not 1_40 [ as this is ambigous ] 315 bool old_cid_lookup = (m_archive_library_version < 5 || (5 == m_archive_library_version && boost_archive_ver_5_is_pre_140)); 316 296 317 class_id_type cid(cobject_info_set.size()); 297 cobject_type co(cid, bis); 298 std::pair<cobject_info_set_type::const_iterator, bool> 299 result = cobject_info_set.insert(co); 318 cobject_type co(cid, bis, old_cid_lookup); 300 319 320 std::pair<cobject_info_set_type::const_iterator, bool> result = cobject_info_set.insert(co); 321 301 322 if(result.second){ 302 323 cobject_id_vector.push_back(cobject_id(bis)); 303 324 BOOST_ASSERT(cobject_info_set.size() == cobject_id_vector.size());