2014-10-14 19:39:26 +00:00
|
|
|
|
|
|
|
#ifndef __ASSERT_H__
|
|
|
|
#define __ASSERT_H__
|
|
|
|
|
|
|
|
#ifndef NDEBUG
|
|
|
|
|
2015-02-02 07:56:45 +00:00
|
|
|
#define assert(_expr) \
|
|
|
|
if (!(_expr)) { \
|
|
|
|
__assert(__func__, __FILE__, __LINE__, #_expr); \
|
|
|
|
}
|
2014-10-14 19:39:26 +00:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
2015-02-02 07:56:45 +00:00
|
|
|
#define assert(_expr)
|
2014-10-14 19:39:26 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void __assert(const char *func, const char *file, int line, const char *expr);
|
|
|
|
|
|
|
|
#endif /* __ASSERT_H__ */
|
|
|
|
|