mirror of
https://git.planet-casio.com/Vhex-Kernel-Core/fxlibc.git
synced 2024-12-29 13:03:38 +01:00
676601b894
This currently does not link because fprintf, stderr and abort are missing on most platforms. But the code is there.
27 lines
652 B
C
27 lines
652 B
C
/*
|
|
** assert.h> can be included several times and the assert macro is redefined
|
|
** every time to match the definition of NDEBUG (7.2§1)
|
|
*/
|
|
#ifdef __ASSERT_H__
|
|
# undef __ASSERT_H__
|
|
# undef assert
|
|
#endif
|
|
|
|
#define __ASSERT_H__
|
|
|
|
/* Internal function that prints error message and aborts */
|
|
void __assert_fail(char const *__file, int __line, char const *__function,
|
|
char const *__expression);
|
|
|
|
#ifdef NDEBUG
|
|
# define assert(ignore) ((void)0)
|
|
#else
|
|
# define assert(expression) \
|
|
((expression) \
|
|
? (void)0 : \
|
|
: __assert_fail(__FILE__, __LINE__, __PRETTY_FUNCTION__, #expression))
|
|
#endif
|
|
|
|
#ifndef __cplusplus
|
|
# define static_assert _Static_assert
|
|
#endif
|