1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
//////////////////////////////////////////////////////////////////////
// Assert.h
//
// Extension of C assert() that allows for error messages.
//////////////////////////////////////////////////////////////////////
#ifndef ASSERT_H
#define ASSERT_H
int _ASSERT_FAILED (const char *filename, int line_number, const char *error_msg);
#ifdef NDEBUG
#define ASSERT(test,error_msg)
#else
#define ASSERT(test,error_msg) (test ? 0 : _ASSERT_FAILED(__FILE__, __LINE__, error_msg))
#endif
#endif
|