AK: Always define ak_assertion_failed, even when NDEBUG is false

Just because we may compile serenity with or without NDEBUG doesn't
mean that consuming projects or Ports will share the setting.

Always define the custom assertion function so that we don't have to
keep the same debug settings between all projects.
This commit is contained in:
Andrew Kaster 2023-02-05 08:15:55 -07:00 committed by Andrew Kaster
parent 17965f4d2d
commit 012aaecccf
Notes: sideshowbarker 2024-07-17 11:34:34 +09:00
2 changed files with 2 additions and 2 deletions

View file

@ -7,7 +7,7 @@
#include <AK/Assertions.h>
#include <AK/Format.h>
#if !defined(KERNEL) && defined(NDEBUG)
#if !defined(KERNEL)
extern "C" {
void ak_verification_failed(char const* message)

View file

@ -10,12 +10,12 @@
# include <Kernel/Assertions.h>
#else
# include <assert.h>
extern "C" __attribute__((noreturn)) void ak_verification_failed(char const*);
# ifndef NDEBUG
# define VERIFY assert
# else
# define __stringify_helper(x) #x
# define __stringify(x) __stringify_helper(x)
extern "C" __attribute__((noreturn)) void ak_verification_failed(char const*);
# define VERIFY(expr) \
(__builtin_expect(!(expr), 0) \
? ak_verification_failed(#expr "\n" __FILE__ ":" __stringify(__LINE__)) \