xtest/include/xtest-assert/assert.h

22 lines
502 B
C
Raw Normal View History

#if defined(__GNUC__) || defined(__clang__) || defined(XTEST_USE_INCLUDE_NEXT)
2022-01-11 20:01:15 +01:00
#include_next <assert.h>
2022-01-11 20:01:15 +01:00
#else
2022-01-02 15:00:54 +01:00
#include <assert.h>
#endif
2022-01-02 15:00:54 +01:00
#define XTEST_XASSERT
#if defined(XTEST) && !defined(XTEST_XTEST_H)
2022-01-02 15:00:54 +01:00
2022-01-11 20:01:15 +01:00
void xtest_internal_assert(const char *file, int line, const char *func, const char *expr);
2022-01-02 15:00:54 +01:00
#undef assert
#define assert(__e) ((__e) ? (void)0 : xtest_internal_assert(__FILE__, __LINE__, \
2022-01-11 20:01:15 +01:00
__func__, #__e))
2022-01-02 15:00:54 +01:00
#endif //defined(XTEST) && !defined(XTEST_XTEST_H)