This code makes debugging somewhat easier. This code is simply a macro definition file.
TRACE macro only outputs messages to the Debug window, moreover, it is of no use with Release builds. The
ASSERT macros are also no use with Release builds. If we could control debug macro regardless of compile mode, it would be easier for us to debug. So I coded this. It is simply macro definition, but useful, I think.
The macros are:
CHECKEXPR(bExpression, ERRORMSG, RETURNVALUE)
CHECKFUNC(bExpression, ERRORMSG, RETURNVALUE)
EXITCHECKEXPR(bExpression, ERRORMSG, RETURNVALUE)
EXITCHECKFUNC(bExpression, ERRORMSG, RETURNVALUE)
If an unexpected situation occurs we would like to exit program at that time, or ignore the situation and force processing. If you want to exit the program, we can use the
EXITCHECK* macro, if you want to ignore the error and continue, use the
The only thing you need to do to use this macro file is add
in you file. You must pre-define
__LJS__DEBUG__NO__ before you add
It works under Unicode and with VC++ 6.0. It's ok for any one use and modify this file freely.