16 lines
300 B
C
16 lines
300 B
C
#ifndef ULIB_ASSERT_H_
|
|
#define ULIB_ASSERT_H_
|
|
|
|
#include <uprintf.h>
|
|
#include <util/util.h>
|
|
|
|
#define ASSERT(X, fmt, ...) \
|
|
do { \
|
|
if (!(X)) { \
|
|
uprintf("ASSERT %s:%d in %s "fmt, __FILE__, __LINE__, __func__, ##__VA_ARGS__); \
|
|
quit(); \
|
|
} \
|
|
} while(0)
|
|
|
|
#endif // ULIB_ASSERT_H_
|