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:
parent
6280ca0275
commit
5b5a881992
2 changed files with 9 additions and 3 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue