1
0
Fork 0
forked from lthn/blockchain

workaround fix for old android sdk with old boost(with missing pfr)

This commit is contained in:
cryptozoidberg 2024-10-23 14:47:02 +04:00
parent 5e4fae1246
commit fd810d5e29
No known key found for this signature in database
GPG key ID: 2E10CC61CAC8F36D

View file

@ -4,8 +4,9 @@
#pragma once
#include <type_traits>
#ifndef MOBILE_WALLET
#include <boost/pfr.hpp>
#endif
#define BEGIN_BOOST_SERIALIZATION() template <class t_archive> void serialize(t_archive &_arch, const unsigned int ver) {
template<size_t A, size_t B> struct TAssertEquality {
@ -37,8 +38,11 @@ template<size_t A, size_t B> struct TAssertEquality {
fields to the structure but forgets to update the serialization map, the compilation will fail. Any update to "num_fields" must
be accompanied by a thorough review of the serialization map to ensure no fields are omitted.
**********************************************************************************************************************************/
#define END_BOOST_SERIALIZATION_TOTAL_FIELDS(num_fields) static_assert(num_fields == boost::pfr::tuple_size<std::remove_reference<decltype(*this)>::type>::value, "Unexpected number of fields!"); }
#ifndef MOBILE_WALLET
#define END_BOOST_SERIALIZATION_TOTAL_FIELDS(num_fields) static_assert(num_fields == boost::pfr::tuple_size<std::remove_reference<decltype(*this)>::type>::value, "Unexpected number of fields!"); }
#else
#define END_BOOST_SERIALIZATION_TOTAL_FIELDS(num_fields) END_BOOST_SERIALIZATION()
#endif
#define BOOST_SERIALIZATION_CURRENT_ARCHIVE_VER(current_version) static const unsigned int current_boost_version_serialization_version = current_version;