mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:48:12 +00:00
LibC+AK: Remove our custom macros from <assert.h>
Other software might not expect these to be defined and behave differently if they _are_ defined, e.g. scummvm which checks if the TODO macro is defined and fails to build if it is.
This commit is contained in:
parent
c6ce7c9326
commit
d2662df57c
5 changed files with 6 additions and 10 deletions
|
@ -10,9 +10,7 @@
|
||||||
# include <Kernel/Assertions.h>
|
# include <Kernel/Assertions.h>
|
||||||
#else
|
#else
|
||||||
# include <assert.h>
|
# include <assert.h>
|
||||||
# ifndef __serenity__
|
# define VERIFY assert
|
||||||
# define VERIFY assert
|
# define VERIFY_NOT_REACHED() assert(false)
|
||||||
# define VERIFY_NOT_REACHED() assert(false)
|
# define TODO VERIFY_NOT_REACHED
|
||||||
# define TODO VERIFY_NOT_REACHED
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <AK/Assertions.h>
|
||||||
#include <AK/Span.h>
|
#include <AK/Span.h>
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
#include <AK/kmalloc.h>
|
#include <AK/kmalloc.h>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <AK/Assertions.h>
|
||||||
#include <AK/Atomic.h>
|
#include <AK/Atomic.h>
|
||||||
#include <AK/Format.h>
|
#include <AK/Format.h>
|
||||||
#include <AK/NonnullRefPtr.h>
|
#include <AK/NonnullRefPtr.h>
|
||||||
|
|
|
@ -19,7 +19,6 @@ __BEGIN_DECLS
|
||||||
if (__builtin_expect(!(expr), 0)) \
|
if (__builtin_expect(!(expr), 0)) \
|
||||||
__assertion_failed(#expr "\n" __FILE__ ":" __stringify(__LINE__)); \
|
__assertion_failed(#expr "\n" __FILE__ ":" __stringify(__LINE__)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
# define VERIFY_NOT_REACHED() assert(false)
|
|
||||||
#else
|
#else
|
||||||
# define assert(expr) ((void)(0))
|
# define assert(expr) ((void)(0))
|
||||||
# define VERIFY_NOT_REACHED() _abort()
|
# define VERIFY_NOT_REACHED() _abort()
|
||||||
|
@ -27,9 +26,6 @@ __BEGIN_DECLS
|
||||||
|
|
||||||
[[noreturn]] void _abort();
|
[[noreturn]] void _abort();
|
||||||
|
|
||||||
#define VERIFY assert
|
|
||||||
#define TODO VERIFY_NOT_REACHED
|
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
# define static_assert _Static_assert
|
# define static_assert _Static_assert
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LibC/assert.h>
|
#include <AK/Assertions.h>
|
||||||
#include <LibC/bits/pthread_forward.h>
|
#include <LibC/bits/pthread_forward.h>
|
||||||
|
|
||||||
static PthreadFunctions s_pthread_functions;
|
static PthreadFunctions s_pthread_functions;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue