mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
AK: Make VERIFY() work in MinSizeRel builds
This commit is contained in:
parent
dab814ea11
commit
2217d91b8d
Notes:
sideshowbarker
2024-07-17 09:34:05 +09:00
Author: https://github.com/awesomekling
Commit: 2217d91b8d
1 changed files with 9 additions and 2 deletions
|
@ -10,8 +10,15 @@
|
||||||
# include <Kernel/Assertions.h>
|
# include <Kernel/Assertions.h>
|
||||||
#else
|
#else
|
||||||
# include <assert.h>
|
# include <assert.h>
|
||||||
# define VERIFY assert
|
# ifndef NDEBUG
|
||||||
# define VERIFY_NOT_REACHED() assert(false) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */
|
# define VERIFY assert
|
||||||
|
# else
|
||||||
|
# define VERIFY(expr) \
|
||||||
|
(__builtin_expect(!(expr), 0) \
|
||||||
|
? __builtin_trap() \
|
||||||
|
: (void)0)
|
||||||
|
# endif
|
||||||
|
# define VERIFY_NOT_REACHED() VERIFY(false) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */
|
||||||
static constexpr bool TODO = false;
|
static constexpr bool TODO = false;
|
||||||
# define TODO() VERIFY(TODO) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */
|
# define TODO() VERIFY(TODO) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue