CI: fix windows build

This commit is contained in:
Markus F.X.J. Oberhumer
2023-01-05 02:29:12 +01:00
parent 72f31787f6
commit 9f00515da4
3 changed files with 60 additions and 38 deletions
+55 -33
View File
@@ -743,8 +743,6 @@ struct upx_compress_result_t
// globals
**************************************************************************/
#include "util/snprintf.h" // must get included first!
#include <exception>
#include <new>
#include <type_traits>
@@ -757,7 +755,11 @@ struct upx_compress_result_t
#include <atomic>
#define upx_std_atomic(Type) std::atomic<Type>
#endif
#if WITH_BOOST_PFR
#include <sstream>
#endif
#include "util/snprintf.h" // must get included first!
#include "options.h"
#include "except.h"
#include "bele.h"
@@ -775,37 +777,6 @@ unsigned membuffer_get_size(MemBuffer &mb);
#include "util/xspan.h"
//#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();
@@ -865,6 +836,57 @@ int upx_test_overlap ( const upx_bytep buf,
int method,
const upx_compress_result_t *cresult );
/*************************************************************************
//
**************************************************************************/
//#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_string(const A &a) {
std::ostringstream ss;
ss << boost::pfr::io(a);
return ss.str();
}
template <class A, class B>
__acc_noinline std::string pfr_string(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_string(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();
}
template <class A, class B, class C, class D>
__acc_noinline std::string pfr_string(const A &a, const B &b, const C &c, const D &d) {
std::ostringstream ss;
ss << boost::pfr::io(a);
ss << ' ';
ss << boost::pfr::io(b);
ss << ' ';
ss << boost::pfr::io(c);
ss << ' ';
ss << boost::pfr::io(d);
return ss.str();
}
// note: this MUST be a macro and not a function because of implicit temporary variable
#define pfr_str(a,...) (pfr_string(a, ##__VA_ARGS__).c_str())
#endif // WITH_BOOST_PFR
/*************************************************************************
// raw_bytes() - get underlying memory from checked buffers/pointers.
// This is overloaded by various utility classes like BoundedPtr,