From dc27c1404acb0640753f98c637d7c14953f6502b Mon Sep 17 00:00:00 2001 From: anonimal Date: Fri, 15 Feb 2019 23:19:10 +0000 Subject: [PATCH 1/2] contrib: update EOS portable archive to 5.1 Source: https://epa.codeplex.com/ --- .../eos/portable_archive_exception.hpp | 11 +++++----- .../eos/portable_iarchive.hpp | 17 +++++++-------- .../eos/portable_oarchive.hpp | 21 +++++++------------ 3 files changed, 21 insertions(+), 28 deletions(-) diff --git a/contrib/eos_portable_archive/eos/portable_archive_exception.hpp b/contrib/eos_portable_archive/eos/portable_archive_exception.hpp index fad9ed5f..719fc004 100644 --- a/contrib/eos_portable_archive/eos/portable_archive_exception.hpp +++ b/contrib/eos_portable_archive/eos/portable_archive_exception.hpp @@ -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 ); /** diff --git a/contrib/eos_portable_archive/eos/portable_iarchive.hpp b/contrib/eos_portable_archive/eos/portable_iarchive.hpp index 54540989..67763f22 100644 --- a/contrib/eos_portable_archive/eos/portable_iarchive.hpp +++ b/contrib/eos_portable_archive/eos/portable_iarchive.hpp @@ -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 #include -#if BOOST_VERSION >= 105600 -#include -#elif BOOST_VERSION >= 103500 +#if BOOST_VERSION >= 103500 && BOOST_VERSION < 105600 #include #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 #include @@ -190,9 +191,7 @@ namespace eos { // load_override functions so we chose to stay one level higher , public boost::archive::basic_binary_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(&temp); } diff --git a/contrib/eos_portable_archive/eos/portable_oarchive.hpp b/contrib/eos_portable_archive/eos/portable_oarchive.hpp index 67f3a695..01fc4497 100644 --- a/contrib/eos_portable_archive/eos/portable_oarchive.hpp +++ b/contrib/eos_portable_archive/eos/portable_oarchive.hpp @@ -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 #include #include -#if BOOST_VERSION >= 105600 -#include -#elif BOOST_VERSION >= 103500 -#include -#endif -#if BOOST_VERSION >= 104500 -#include -#include +#if BOOST_VERSION >= 103500 && BOOST_VERSION < 105600 +#include #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 #include @@ -195,9 +192,7 @@ namespace eos { // save_override functions so we chose to stay one level higher , public boost::archive::basic_binary_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 From 3fa6bad35f5926b02991c090dfc73158f7e2f2b4 Mon Sep 17 00:00:00 2001 From: anonimal Date: Fri, 15 Feb 2019 23:33:16 +0000 Subject: [PATCH 2/2] contrib: fix EOS portable archive for Boost 1.69 Boost 1.69 (Spirit.X2/X3) has dropped their own FP routines in favor of boost::math. https://www.boost.org/users/history/version_1_69_0.html --- contrib/eos_portable_archive/eos/portable_iarchive.hpp | 5 +++-- contrib/eos_portable_archive/eos/portable_oarchive.hpp | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/contrib/eos_portable_archive/eos/portable_iarchive.hpp b/contrib/eos_portable_archive/eos/portable_iarchive.hpp index 67763f22..5d34b1d1 100644 --- a/contrib/eos_portable_archive/eos/portable_iarchive.hpp +++ b/contrib/eos_portable_archive/eos/portable_iarchive.hpp @@ -116,14 +116,15 @@ #include #elif BOOST_VERSION < 104800 #include +// Boost 1.69 (Spirit.X2/X3) has dropped their own FP routines in favor of boost::math +#elif BOOST_VERSION < 106900 #include #else #include -#include #endif // namespace alias -#if BOOST_VERSION < 103800 +#if BOOST_VERSION < 103800 || BOOST_VERSION >= 106900 namespace fp = boost::math; #else namespace fp = boost::spirit::math; diff --git a/contrib/eos_portable_archive/eos/portable_oarchive.hpp b/contrib/eos_portable_archive/eos/portable_oarchive.hpp index 01fc4497..ca94858b 100644 --- a/contrib/eos_portable_archive/eos/portable_oarchive.hpp +++ b/contrib/eos_portable_archive/eos/portable_oarchive.hpp @@ -119,14 +119,15 @@ #include #elif BOOST_VERSION < 104800 #include +// Boost 1.69 (Spirit.X2/X3) has dropped their own FP routines in favor of boost::math +#elif BOOST_VERSION < 106900 #include #else #include -#include #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;