2022-10-15 08:05:48 +00:00
|
|
|
#ifndef _ASSERT_H
|
|
|
|
#define _ASSERT_H
|
|
|
|
|
|
|
|
#include <bits/macros.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
|
|
|
__lc_noreturn bool __assertion_failed(const char* file, int line, const char* function, const char* expr);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef NDEBUG
|
|
|
|
#define assert(expr) (void)0
|
|
|
|
#else
|
2022-10-25 17:27:24 +00:00
|
|
|
#define assert(expr) (bool)(expr) || __assertion_failed(__FILE__, __LINE__, __FUNCTION__, #expr) // Verify a condition.
|
2022-10-15 08:05:48 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|