forked from lthn/blockchain
contrib: update EOS portable archive to 5.1
Source: https://epa.codeplex.com/
This commit is contained in:
parent
d1d048f4b0
commit
dc27c1404a
3 changed files with 21 additions and 28 deletions
|
|
@ -35,12 +35,11 @@ namespace eos {
|
|||
|
||||
// version of the linked boost archive library
|
||||
const archive_version_type archive_version(
|
||||
11
|
||||
// #if BOOST_VERSION < 103700
|
||||
// boost::archive::ARCHIVE_VERSION()
|
||||
// #else
|
||||
// boost::archive::BOOST_ARCHIVE_VERSION()
|
||||
// #endif
|
||||
#if BOOST_VERSION < 103700
|
||||
boost::archive::ARCHIVE_VERSION()
|
||||
#else
|
||||
boost::archive::BOOST_ARCHIVE_VERSION()
|
||||
#endif
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* \file portable_iarchive.hpp
|
||||
* \brief Provides an archive to read from portable binary files.
|
||||
* \author christian.pfligersdorffer@gmx.at
|
||||
* \version 5.0
|
||||
* \version 5.1
|
||||
*
|
||||
* This pair of archives brings the advantages of binary streams to the cross
|
||||
* platform boost::serialization user. While being almost as fast as the native
|
||||
|
|
@ -23,6 +23,9 @@
|
|||
* chance it will instantly work for your specific setup. If you encounter
|
||||
* problems or have suggestions please contact the author.
|
||||
*
|
||||
* \note Version 5.1 is now compatible with boost up to version 1.59. Thanks to
|
||||
* ecotax for pointing to the issue with shared_ptr_helper.
|
||||
*
|
||||
* \note Version 5.0 is now compatible with boost up to version 1.49 and enables
|
||||
* serialization of std::wstring by converting it to/from utf8 (thanks to
|
||||
* Arash Abghari for this suggestion). With that all unit tests from the
|
||||
|
|
@ -89,9 +92,7 @@
|
|||
#include <boost/archive/basic_binary_iprimitive.hpp>
|
||||
#include <boost/archive/basic_binary_iarchive.hpp>
|
||||
|
||||
#if BOOST_VERSION >= 105600
|
||||
#include <boost/serialization/shared_ptr_helper.hpp>
|
||||
#elif BOOST_VERSION >= 103500
|
||||
#if BOOST_VERSION >= 103500 && BOOST_VERSION < 105600
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
#endif
|
||||
|
||||
|
|
@ -135,7 +136,7 @@ namespace endian = boost::detail;
|
|||
namespace endian = boost::spirit::detail;
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
#if BOOST_VERSION >= 104500 && !defined BOOST_NO_STD_WSTRING
|
||||
// used for wstring to utf8 conversion
|
||||
#include <boost/program_options/config.hpp>
|
||||
#include <boost/program_options/detail/convert.hpp>
|
||||
|
|
@ -190,9 +191,7 @@ namespace eos {
|
|||
// load_override functions so we chose to stay one level higher
|
||||
, public boost::archive::basic_binary_iarchive<portable_iarchive>
|
||||
|
||||
#if BOOST_VERSION >= 105600
|
||||
// mix-in helper class for serializing shared_ptr does not exist anymore
|
||||
#elif BOOST_VERSION >= 103500
|
||||
#if BOOST_VERSION >= 103500 && BOOST_VERSION < 105600
|
||||
// mix-in helper class for serializing shared_ptr
|
||||
, public boost::archive::detail::shared_ptr_helper
|
||||
#endif
|
||||
|
|
@ -349,7 +348,7 @@ namespace eos {
|
|||
T temp = size < 0 ? -1 : 0;
|
||||
load_binary(&temp, abs(size));
|
||||
|
||||
// load the value from little endian - is is then converted
|
||||
// load the value from little endian - it is then converted
|
||||
// to the target type T and fits it because size <= sizeof(T)
|
||||
t = endian::load_little_endian<T, sizeof(T)>(&temp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* \file portable_oarchive.hpp
|
||||
* \brief Provides an archive to create portable binary files.
|
||||
* \author christian.pfligersdorffer@gmx.at
|
||||
* \version 5.0
|
||||
* \version 5.1
|
||||
*
|
||||
* This pair of archives brings the advantages of binary streams to the cross
|
||||
* platform boost::serialization user. While being almost as fast as the native
|
||||
|
|
@ -23,6 +23,9 @@
|
|||
* chance it will instantly work for your specific setup. If you encounter
|
||||
* problems or have suggestions please contact the author.
|
||||
*
|
||||
* \note Version 5.1 is now compatible with boost up to version 1.59. Thanks to
|
||||
* ecotax for pointing to the issue with shared_ptr_helper.
|
||||
*
|
||||
* \note Version 5.0 is now compatible with boost up to version 1.49 and enables
|
||||
* serialization of std::wstring by converting it to/from utf8 (thanks to
|
||||
* Arash Abghari for this suggestion). With that all unit tests from the
|
||||
|
|
@ -91,15 +94,9 @@
|
|||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/archive/basic_binary_oprimitive.hpp>
|
||||
#include <boost/archive/basic_binary_oarchive.hpp>
|
||||
#if BOOST_VERSION >= 105600
|
||||
#include <boost/serialization/shared_ptr_helper.hpp>
|
||||
#elif BOOST_VERSION >= 103500
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
#endif
|
||||
|
||||
#if BOOST_VERSION >= 104500
|
||||
#include <boost/program_options/config.hpp>
|
||||
#include <boost/program_options/detail/convert.hpp>
|
||||
#if BOOST_VERSION >= 103500 && BOOST_VERSION < 105600
|
||||
#include <boost/archive/shared_ptr_helper.hpp>
|
||||
#endif
|
||||
|
||||
// funny polymorphics
|
||||
|
|
@ -142,7 +139,7 @@ namespace endian = boost::detail;
|
|||
namespace endian = boost::spirit::detail;
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_STD_WSTRING
|
||||
#if BOOST_VERSION >= 104500 && !defined BOOST_NO_STD_WSTRING
|
||||
// used for wstring to utf8 conversion
|
||||
#include <boost/program_options/config.hpp>
|
||||
#include <boost/program_options/detail/convert.hpp>
|
||||
|
|
@ -195,9 +192,7 @@ namespace eos {
|
|||
// save_override functions so we chose to stay one level higher
|
||||
, public boost::archive::basic_binary_oarchive<portable_oarchive>
|
||||
|
||||
#if BOOST_VERSION >= 105600
|
||||
// mix-in helper class for serializing shared_ptr does not exist anymore
|
||||
#elif BOOST_VERSION >= 103500
|
||||
#if BOOST_VERSION >= 103500 && BOOST_VERSION < 105600
|
||||
// mix-in helper class for serializing shared_ptr
|
||||
, public boost::archive::detail::shared_ptr_helper
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue