//***************************************************************************** // // Prototype for the function that is called when an invalid argument is passed // to an API. This is only used when doing a DEBUG build. // //***************************************************************************** extern void __error__(char *pcFilename, unsigned long ulLine);
//***************************************************************************** // // The ASSERT macro, which does the actual assertion checking. Typically, this // will be for procedure arguments. // //***************************************************************************** #ifdef DEBUG #define ASSERT(expr) { if(!(expr)) { __error__(__FILE__, __LINE__); } } #else #define ASSERT(expr) #endif
函数原型在StellarisWare_for_EK-LM3S811driverlibdebug.h
#ifndef __DEBUG_H__
#define __DEBUG_H__
//*****************************************************************************
//
// Prototype for the function that is called when an invalid argument is passed
// to an API. This is only used when doing a DEBUG build.
//
//*****************************************************************************
extern void __error__(char *pcFilename, unsigned long ulLine);
//*****************************************************************************
//
// The ASSERT macro, which does the actual assertion checking. Typically, this
// will be for procedure arguments.
//
//*****************************************************************************
#ifdef DEBUG
#define ASSERT(expr) {
if(!(expr))
{
__error__(__FILE__, __LINE__);
}
}
#else
#define ASSERT(expr)
#endif
#endif // __DEBUG_H__
一周热门 更多>