Files
ladybird/Libraries/LibTest/AssertionHandler.h
Undefine 5b5a881992 LibTest: Fix custom assertion handler on FreeBSD and OpenBSD
Those systems expect sigjmp_buf to be passed to sigsetjmp / siglongjmp
instead of jmp_buf.
2026-01-12 20:58:21 +01:00

34 lines
671 B
C++

/*
* Copyright (c) 2025, ayeteadoe <ayeteadoe@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Platform.h>
#include <LibTest/Export.h>
#include <setjmp.h>
#ifndef AK_OS_WINDOWS
# define LIBTEST_SETJMP(env) sigsetjmp(env, 1)
# define LIBTEST_LONGJMP siglongjmp
#else
# define LIBTEST_SETJMP(env) setjmp(env)
# 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 {
libtest_jmp_buf& assertion_jump_buffer();
void set_assertion_jump_validity(bool);
bool assertion_jump_validity();
}