all: assorted cleanups

This commit is contained in:
Markus F.X.J. Oberhumer
2024-01-24 20:53:14 +01:00
parent 65b25adceb
commit 5d649f83ec
27 changed files with 535 additions and 367 deletions
+12 -1
View File
@@ -176,7 +176,7 @@ void uintptr_check_no_overlap(upx_uintptr_t a, size_t a_size, upx_uintptr_t b, s
throwCantPack("ptr_check_no_overlap-bc");
}
#if !defined(DOCTEST_CONFIG_DISABLE) && DEBUG
#if !defined(DOCTEST_CONFIG_DISABLE) && !defined(__wasi__) && DEBUG
TEST_CASE("ptr_check_no_overlap 2") {
byte p[4] = {};
@@ -922,4 +922,15 @@ TEST_CASE("get_ratio") {
CHECK(get_ratio(2 * UPX_RSIZE_MAX, 1024ull * UPX_RSIZE_MAX) == 9999999);
}
/*************************************************************************
// compat
**************************************************************************/
#if defined(__wasi__) // TODO later - wait for wasm/wasi exception handling proposal
extern "C" {
void __cxa_allocate_exception() { std::terminate(); }
void __cxa_throw() { std::terminate(); }
} // extern "C"
#endif
/* vim:set ts=4 sw=4 et: */