1
0
Fork 0
forked from lthn/blockchain

Merge pull request #7 from anonimal/eos-update

contrib: EOS portable archive update + Boost 1.69 fix
This commit is contained in:
cryptozoidberg 2019-02-17 13:48:35 +01:00 committed by GitHub
commit c39931a8da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 32 deletions

View file

@ -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
);
/**

View file

@ -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
@ -115,14 +116,15 @@
#include <boost/math/fpclassify.hpp>
#elif BOOST_VERSION < 104800
#include <boost/spirit/home/support/detail/integer/endian.hpp>
// Boost 1.69 (Spirit.X2/X3) has dropped their own FP routines in favor of boost::math
#elif BOOST_VERSION < 106900
#include <boost/spirit/home/support/detail/math/fpclassify.hpp>
#else
#include <boost/spirit/home/support/detail/endian/endian.hpp>
#include <boost/spirit/home/support/detail/math/fpclassify.hpp>
#endif
// namespace alias
#if BOOST_VERSION < 103800
#if BOOST_VERSION < 103800 || BOOST_VERSION >= 106900
namespace fp = boost::math;
#else
namespace fp = boost::spirit::math;
@ -135,7 +137,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 +192,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 +349,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);
}

View file

@ -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
@ -122,14 +119,15 @@
#include <boost/math/fpclassify.hpp>
#elif BOOST_VERSION < 104800
#include <boost/spirit/home/support/detail/integer/endian.hpp>
// Boost 1.69 (Spirit.X2/X3) has dropped their own FP routines in favor of boost::math
#elif BOOST_VERSION < 106900
#include <boost/spirit/home/support/detail/math/fpclassify.hpp>
#else
#include <boost/spirit/home/support/detail/endian/endian.hpp>
#include <boost/spirit/home/support/detail/math/fpclassify.hpp>
#endif
// namespace alias fp_classify
#if BOOST_VERSION < 103800
#if BOOST_VERSION < 103800 || BOOST_VERSION >= 106900
namespace fp = boost::math;
#else
namespace fp = boost::spirit::math;
@ -142,7 +140,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 +193,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