2020-01-18 11:38:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 11:24:48 +03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 11:38:21 +03:00
|
|
|
*/
|
|
|
|
|
2018-10-10 12:53:07 +03:00
|
|
|
#pragma once
|
|
|
|
|
2021-02-23 10:33:03 +03:00
|
|
|
#if defined(KERNEL)
|
|
|
|
# include <Kernel/Assertions.h>
|
|
|
|
#else
|
|
|
|
# include <assert.h>
|
2022-07-08 15:16:53 +03:00
|
|
|
# ifndef NDEBUG
|
|
|
|
# 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 */
|
2021-08-03 23:02:19 +03:00
|
|
|
static constexpr bool TODO = false;
|
2022-02-21 19:34:19 +03:00
|
|
|
# define TODO() VERIFY(TODO) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */
|
2019-08-02 10:23:03 +03:00
|
|
|
#endif
|