From 012aaecccfb1a7f58825e68cd747398a9548fdae Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 5 Feb 2023 08:15:55 -0700 Subject: [PATCH] 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. --- AK/Assertions.cpp | 2 +- AK/Assertions.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AK/Assertions.cpp b/AK/Assertions.cpp index d8ac0283455..6f40a0b085f 100644 --- a/AK/Assertions.cpp +++ b/AK/Assertions.cpp @@ -7,7 +7,7 @@ #include #include -#if !defined(KERNEL) && defined(NDEBUG) +#if !defined(KERNEL) extern "C" { void ak_verification_failed(char const* message) diff --git a/AK/Assertions.h b/AK/Assertions.h index d3de619a72f..0c01eddc58c 100644 --- a/AK/Assertions.h +++ b/AK/Assertions.h @@ -10,12 +10,12 @@ # include #else # include +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__)) \