void cbl::Assert( Char * const expression, const Char * const message, const Char * const filename, const size_t line ) { String file( filename ); Ostringstream msg; msg << _STR( "Expression: " ) << expression << std::endl << "@ " << file.substr( file.find_last_of( '\\' ) + 1 ) << ":" << line << std::endl << std::endl << _STR( "Message: ") << std::endl << message << std::endl; int result = ::MessageBox( NULL, msg.str().c_str(), _STR("Assertion Error"), MB_ABORTRETRYIGNORE | MB_ICONERROR | MB_DEFBUTTON2 ); switch( result ) { case IDABORT: ::exit( EXIT_FAILURE ); break; case IDRETRY: ::DebugBreak(); break; case IDIGNORE: break; } }
void BH::Assert(Char * const expression, const Char * const message, const Char * const filename, const size_t line) { String file(filename); Ostringstream msg; msg << "Expression: " << expression << std::endl << "File: " << file.substr(file.find_last_of('\\') + 1) << ", Line: " << line << std::endl << std::endl << "Message: " << std::endl << message << std::endl; CreateMessageBox( msg.str( ).c_str( ), "Assertion Error" ); }