Luna/libs/libc/include/assert.h

24 lines
448 B
C
Raw Normal View History

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
#define assert(expr) (bool)(expr) || __assertion_failed(__FILE__, __LINE__, __FUNCTION__, #expr) // Verify a condition.
2022-10-15 08:05:48 +00:00
#endif
#endif