diff --git a/doc/exceptions.html b/doc/exceptions.html
index 789ebc16..c5d6635e 100644
--- a/doc/exceptions.html
+++ b/doc/exceptions.html
@@ -118,7 +118,7 @@ the archive is opened, It is presumed that this file is not a valid archive and
exception is thrown.
-This system assigns a version number of 3 to all archives created. Note that this is in
+This system records the current library version number to all archives created. Note that this is in
no way related to version number of classes used by application programs. This refers
to the version of the serialization system used to create the archive. Future versions
of this serialization system will be able to identify archives created under previous
diff --git a/doc/release.html b/doc/release.html
index 96579b37..eb785438 100644
--- a/doc/release.html
+++ b/doc/release.html
@@ -29,6 +29,7 @@ http://www.boost.org/LICENSE_1_0.txt)
@@ -44,6 +45,13 @@ http://www.boost.org/LICENSE_1_0.txt)
As of this writing, there are no known bugs. However, due to compiler/library
quirks and or bugs, some tests fail with some combinations of compilers and
libraries.
+
Differences from Boost 1.45
+Since the release of version 1.42, it has been discovered that binary
+archives created by versions 1.42-1.44 cannot always be read by the
+recent binary archive code. Work has proceeded in detecting the source
+of these anomolies and those which have been reported with test cases
+have been fixed. As of this writing, it is not known whether all
+binary archives created with these versions can be loaded.
Differences from Boost 1.43
fixed bug in the serialization of virtual base classes. Due
diff --git a/src/archive_exception.cpp b/src/archive_exception.cpp
index 589915c3..50d326a7 100644
--- a/src/archive_exception.cpp
+++ b/src/archive_exception.cpp
@@ -13,7 +13,7 @@
#endif
#include
-#include
+#include
#include
#define BOOST_ARCHIVE_SOURCE
@@ -93,7 +93,7 @@ archive_exception::archive_exception(
m_msg = "output stream error";
break;
default:
- assert(false);
+ BOOST_ASSERT(false);
break;
}
}
diff --git a/src/basic_archive.cpp b/src/basic_archive.cpp
index 78a068b3..b4c9463b 100644
--- a/src/basic_archive.cpp
+++ b/src/basic_archive.cpp
@@ -73,7 +73,7 @@ BOOST_ARCHIVE_SIGNATURE(){
BOOST_ARCHIVE_DECL(library_version_type)
BOOST_ARCHIVE_VERSION(){
- return library_version_type(8);
+ return library_version_type(9);
}
} // namespace archive
diff --git a/src/basic_iarchive.cpp b/src/basic_iarchive.cpp
index 29a9a259..e9badddb 100644
--- a/src/basic_iarchive.cpp
+++ b/src/basic_iarchive.cpp
@@ -10,7 +10,7 @@
#include // msvc 6.0 needs this to suppress warnings
-#include
+#include
#include
#include
#include
@@ -300,7 +300,7 @@ basic_iarchive_impl::register_type(
if(result.second){
cobject_id_vector.push_back(cobject_id(bis));
- assert(cobject_info_set.size() == cobject_id_vector.size());
+ BOOST_ASSERT(cobject_info_set.size() == cobject_id_vector.size());
}
cid = result.first->m_class_id;
// borland complains without this minor hack
@@ -433,11 +433,11 @@ basic_iarchive_impl::load_pointer(
);
bpis_ptr = (*finder)(*eti);
}
- assert(NULL != bpis_ptr);
+ BOOST_ASSERT(NULL != bpis_ptr);
class_id_type new_cid = register_type(bpis_ptr->get_basic_serializer());
int i = cid;
cobject_id_vector[i].bpis_ptr = bpis_ptr;
- assert(new_cid == cid);
+ BOOST_ASSERT(new_cid == cid);
}
int i = cid;
cobject_id & co = cobject_id_vector[i];
@@ -484,7 +484,7 @@ basic_iarchive_impl::load_pointer(
);
t = object_id_vector[ui].address;
object_id_vector[ui].loaded_as_pointer = true;
- assert(NULL != t);
+ BOOST_ASSERT(NULL != t);
}
return bpis_ptr;
diff --git a/src/basic_oarchive.cpp b/src/basic_oarchive.cpp
index f3473b9a..33f33f88 100644
--- a/src/basic_oarchive.cpp
+++ b/src/basic_oarchive.cpp
@@ -10,7 +10,7 @@
#include // msvc 6.0 needs this for warning suppression
-#include
+#include
#include
#include // NULL
@@ -59,8 +59,8 @@ class basic_oarchive_impl {
bool operator<(const aobject &rhs) const
{
- assert(NULL != address);
- assert(NULL != rhs.address);
+ BOOST_ASSERT(NULL != address);
+ BOOST_ASSERT(NULL != rhs.address);
if( address < rhs.address )
return true;
if( address > rhs.address )
@@ -178,28 +178,28 @@ basic_oarchive_impl::find(const serialization::extended_type_info & ti) const {
public basic_oserializer
{
bool class_info() const {
- assert(false);
+ BOOST_ASSERT(false);
return false;
}
// returns true if objects should be tracked
bool tracking(const unsigned int) const {
- assert(false);
+ BOOST_ASSERT(false);
return false;
}
// returns class version
version_type version() const {
- assert(false);
+ BOOST_ASSERT(false);
return version_type(0);
}
// returns true if this class is polymorphic
bool is_polymorphic() const{
- assert(false);
+ BOOST_ASSERT(false);
return false;
}
void save_object_data(
basic_oarchive & /*ar*/, const void * /*x*/
) const {
- assert(false);
+ BOOST_ASSERT(false);
}
public:
bosarg(const serialization::extended_type_info & eti) :
diff --git a/src/basic_serializer_map.cpp b/src/basic_serializer_map.cpp
index c6cfb733..80e805fa 100644
--- a/src/basic_serializer_map.cpp
+++ b/src/basic_serializer_map.cpp
@@ -99,7 +99,7 @@ basic_serializer_map::find(
map_type::const_iterator it;
it = m_map.find(& bs);
if(it == m_map.end()){
- assert(false);
+ BOOST_ASSERT(false);
return 0;
}
return *it;
diff --git a/src/extended_type_info.cpp b/src/extended_type_info.cpp
index bc28d6ad..2efbefc8 100644
--- a/src/extended_type_info.cpp
+++ b/src/extended_type_info.cpp
@@ -15,7 +15,7 @@
#include
#include
#include
-#include
+#include
#include // NULL
#include // msvc needs this to suppress warning
@@ -52,9 +52,9 @@ struct key_compare
if(lhs == rhs)
return false;
const char * l = lhs->get_key();
- assert(NULL != l);
+ BOOST_ASSERT(NULL != l);
const char * r = rhs->get_key();
- assert(NULL != r);
+ BOOST_ASSERT(NULL != r);
// performance shortcut
// shortcut to exploit string pooling
if(l == r)
@@ -77,23 +77,23 @@ class extended_type_info_arg : public extended_type_info
{
virtual bool
is_less_than(const extended_type_info & /*rhs*/) const {
- assert(false);
+ BOOST_ASSERT(false);
return false;
};
virtual bool
is_equal(const extended_type_info & /*rhs*/) const {
- assert(false);
+ BOOST_ASSERT(false);
return false;
};
virtual const char * get_debug_info() const {
return get_key();
}
virtual void * construct(unsigned int /*count*/, ...) const{
- assert(false);
+ BOOST_ASSERT(false);
return NULL;
}
virtual void destroy(void const * const /*p*/) const {
- assert(false);
+ BOOST_ASSERT(false);
}
public:
extended_type_info_arg(const char * key) :
@@ -137,7 +137,7 @@ extended_type_info::key_unregister() const{
BOOST_SERIALIZATION_DECL(const extended_type_info *)
extended_type_info::find(const char *key) {
- assert(NULL != key);
+ BOOST_ASSERT(NULL != key);
const detail::ktmap & k = singleton::get_const_instance();
const detail::extended_type_info_arg eti_key(key);
const detail::ktmap::const_iterator it = k.find(& eti_key);
diff --git a/src/extended_type_info_no_rtti.cpp b/src/extended_type_info_no_rtti.cpp
index cb4f14f9..3b2a8884 100644
--- a/src/extended_type_info_no_rtti.cpp
+++ b/src/extended_type_info_no_rtti.cpp
@@ -11,7 +11,7 @@
#include
#include // NULL
-#include
+#include
#include
#if defined(BOOST_NO_STDC_NAMESPACE)
@@ -52,8 +52,8 @@ extended_type_info_no_rtti_0::is_less_than(
// through a pointer to the to most derived class. OR make sure
// that the BOOST_CLASS_EXPORT is included in every file
// which does this.
- assert(NULL != l);
- assert(NULL != r);
+ BOOST_ASSERT(NULL != l);
+ BOOST_ASSERT(NULL != r);
return std::strcmp(l, r) < 0;
}
@@ -66,11 +66,11 @@ extended_type_info_no_rtti_0::is_equal(
return true;
// null keys don't match with anything
const char * l = get_key();
- assert(NULL != l);
+ BOOST_ASSERT(NULL != l);
if(NULL == l)
return false;
const char * r = rhs.get_key();
- assert(NULL != r);
+ BOOST_ASSERT(NULL != r);
if(NULL == r)
return false;
return 0 == std::strcmp(l, r);
diff --git a/src/extended_type_info_typeid.cpp b/src/extended_type_info_typeid.cpp
index 6e62b40d..463287af 100644
--- a/src/extended_type_info_typeid.cpp
+++ b/src/extended_type_info_typeid.cpp
@@ -11,7 +11,7 @@
#include
#include
-#include
+#include
#include
#include // NULL
@@ -96,7 +96,7 @@ extended_type_info_typeid_0::type_unregister()
tkmap & x = singleton::get_mutable_instance();
tkmap::iterator start = x.lower_bound(this);
tkmap::iterator end = x.upper_bound(this);
- assert(start != end);
+ BOOST_ASSERT(start != end);
// remove entry in map which corresponds to this type
do{
@@ -120,11 +120,11 @@ class extended_type_info_typeid_arg :
public extended_type_info_typeid_0
{
virtual void * construct(unsigned int /*count*/, ...) const{
- assert(false);
+ BOOST_ASSERT(false);
return NULL;
}
virtual void destroy(void const * const /*p*/) const {
- assert(false);
+ BOOST_ASSERT(false);
}
public:
extended_type_info_typeid_arg(const std::type_info & ti) :
diff --git a/src/shared_ptr_helper.cpp b/src/shared_ptr_helper.cpp
index 33c15b78..b155cd94 100644
--- a/src/shared_ptr_helper.cpp
+++ b/src/shared_ptr_helper.cpp
@@ -103,7 +103,7 @@ shared_ptr_helper::append(const boost::shared_ptr &sp){
if(i == m_pointers->end()){
std::pair result;
result = m_pointers->insert(sp);
- assert(result.second);
+ BOOST_ASSERT(result.second);
}
}
diff --git a/src/void_cast.cpp b/src/void_cast.cpp
index de841716..16cd4202 100644
--- a/src/void_cast.cpp
+++ b/src/void_cast.cpp
@@ -13,7 +13,7 @@
# pragma warning (disable : 4786) // too long name, harmless warning
#endif
-#include
+#include
#include // NULL
#ifdef BOOST_SERIALIZATION_LOG
#include
@@ -23,7 +23,7 @@
#include
#include
#include
-#include
+#include
// BOOST
#define BOOST_SERIALIZATION_SOURCE
@@ -185,16 +185,16 @@ class void_caster_argument : public void_caster
{
virtual void const *
upcast(void const * const /*t*/) const {
- assert(false);
+ BOOST_ASSERT(false);
return NULL;
}
virtual void const *
downcast( void const * const /*t*/) const {
- assert(false);
+ BOOST_ASSERT(false);
return NULL;
}
virtual bool has_virtual_base() const {
- assert(false);
+ BOOST_ASSERT(false);
return false;
}
public:
diff --git a/src/xml_archive_exception.cpp b/src/xml_archive_exception.cpp
index f011066e..ea78916a 100644
--- a/src/xml_archive_exception.cpp
+++ b/src/xml_archive_exception.cpp
@@ -14,7 +14,7 @@
#include
-#include
+#include
#include
#define BOOST_ARCHIVE_SOURCE
@@ -47,7 +47,7 @@ xml_archive_exception::xml_archive_exception(
m_msg = "Invalid XML tag name";
break;
default:
- assert(false);
+ BOOST_ASSERT(false);
break;
}
}
diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
index 3ed06ee8..e5524d21 100644
--- a/test/Jamfile.v2
+++ b/test/Jamfile.v2
@@ -8,6 +8,7 @@
project libs/serialization/test
: id serialization_test
+ : requirements /boost/filesystem
;
# import rules from the boost serialization test
diff --git a/test/test_tools.hpp b/test/test_tools.hpp
index bf2656c9..53ea6b8b 100644
--- a/test/test_tools.hpp
+++ b/test/test_tools.hpp
@@ -1,6 +1,9 @@
#ifndef BOOST_SERIALIZATION_TEST_TOOLS_HPP
#define BOOST_SERIALIZATION_TEST_TOOLS_HPP
+#define BOOST_FILESYSTEM_VERSION 3
+#include
+
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
@@ -16,7 +19,6 @@
// See http://www.boost.org for updates, documentation, and revision history.
-#include // remove, tmpnam
#include // size_t
#ifndef BOOST_NO_EXCEPTION_STD_NAMESPACE
#include
@@ -87,7 +89,11 @@ namespace archive {
char old_dir[256];
_getcwd(old_dir, sizeof(old_dir) - 1);
chdir(dir);
- std::tmpnam(ibuffer + i);
+ // (C) Copyright 2010 Dean Michael Berris.
+ // Instead of using std::tmpnam, we use Boost.Filesystem's unique_path
+ boost::filesystem::path tmp_path =
+ boost::filesystem::unique_path("%%%%%");
+ std::strcat(ibuffer, tmp_path.string().c_str());
chdir(old_dir);
}
else{
@@ -118,15 +124,33 @@ namespace archive {
namespace boost {
namespace archive {
- using ::tempnam;
+ using ::tmpnam;
} // archive
} // boost
#else // defined(__hpux)
+// (C) Copyright 2010 Dean Michael Berris.
+// Instead of using the potentially dangrous tempnam function that's part
+// of the C standard library, on Unix/Linux we use the more portable and
+// "safe" unique_path function provided in the Boost.Filesystem library.
+
+#include
+
namespace boost {
namespace archive {
- using std::tmpnam;
+ char const * tmpnam(char * buffer) {
+ static char name[512] = {0};
+ if (name[0] == 0) {
+ boost::filesystem::path tempdir(tmpdir());
+ boost::filesystem::path tempfilename =
+ boost::filesystem::unique_path("serialization-%%%%");
+ boost::filesystem::path temp = tempdir / tempfilename;
+ std::strcat(name, temp.string().c_str());
+ }
+ if (buffer != 0) std::strcpy(buffer, name);
+ return name;
+ }
} // archive
} // boost