mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
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:
Notes:
github-actions[bot]
2026-01-12 19:59:35 +00:00
Author: https://github.com/cqundefine Commit: https://github.com/LadybirdBrowser/ladybird/commit/5b5a881992e Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7413 Reviewed-by: https://github.com/shannonbooth
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user