LibTest: Fix custom assertion handler on FreeBSD and OpenBSD

Those systems expect sigjmp_buf to be passed to sigsetjmp / siglongjmp
instead of jmp_buf.
This commit is contained in:
Undefine
2026-01-10 16:21:01 +01:00
committed by Shannon Booth
parent 6280ca0275
commit 5b5a881992
Notes: github-actions[bot] 2026-01-12 19:59:35 +00:00
2 changed files with 9 additions and 3 deletions

View File

@@ -8,11 +8,11 @@
namespace Test {
static jmp_buf g_assert_jmp_buf = {};
static libtest_jmp_buf g_assert_jmp_buf = {};
static bool g_assert_jmp_buf_valid = false;
jmp_buf& assertion_jump_buffer() { return g_assert_jmp_buf; }
libtest_jmp_buf& assertion_jump_buffer() { return g_assert_jmp_buf; }
void set_assertion_jump_validity(bool validity)
{

View File

@@ -18,9 +18,15 @@
# define LIBTEST_LONGJMP longjmp
#endif
#if defined(AK_OS_FREEBSD) || defined(AK_OS_OPENBSD)
using libtest_jmp_buf = sigjmp_buf;
#else
using libtest_jmp_buf = jmp_buf;
#endif
namespace Test {
jmp_buf& assertion_jump_buffer();
libtest_jmp_buf& assertion_jump_buffer();
void set_assertion_jump_validity(bool);
bool assertion_jump_validity();