src: add boost-pfr

This commit is contained in:
Markus F.X.J. Oberhumer
2023-01-05 00:57:05 +01:00
parent d9657e9831
commit cd686cb1d9
5 changed files with 67 additions and 1 deletions
+28
View File
@@ -778,6 +778,34 @@ unsigned membuffer_get_size(MemBuffer &mb);
//#define DOCTEST_CONFIG_DISABLE 1
#include <doctest/doctest/parts/doctest_fwd.h>
#if WITH_BOOST_PFR
#include <boost/pfr/io.hpp>
template <class A>
__acc_noinline std::string pfr_str(const A &a) {
std::ostringstream ss;
ss << boost::pfr::io(a);
return ss.str();
}
template <class A, class B>
__acc_noinline std::string pfr_str(const A &a, const B &b) {
std::ostringstream ss;
ss << boost::pfr::io(a);
ss << ' ';
ss << boost::pfr::io(b);
return ss.str();
}
template <class A, class B, class C>
__acc_noinline std::string pfr_str(const A &a, const B &b, const C &c) {
std::ostringstream ss;
ss << boost::pfr::io(a);
ss << ' ';
ss << boost::pfr::io(b);
ss << ' ';
ss << boost::pfr::io(c);
return ss.str();
}
#endif // WITH_BOOST_PFR
// util/dt_check.cpp
void upx_compiler_sanity_check();
int upx_doctest_check();