/******************************************************************* Dutil_Assert *******************************************************************/ extern "C" void DAPI Dutil_Assert( __in LPCSTR szFile, __in int iLine ) { HRESULT hr = S_OK; char szMessage[DUTIL_STRING_BUFFER]; hr = StringCchPrintfA(szMessage, countof(szMessage), "Assertion failed in %s, %i", szFile, iLine); if (SUCCEEDED(hr)) Dutil_AssertMsg(szMessage); else Dutil_AssertMsg("Assert failed to build string"); }
/******************************************************************* Dutil_AssertSz *******************************************************************/ extern "C" void DAPI Dutil_AssertSz( __in_z LPCSTR szFile, __in int iLine, __in_z __format_string LPCSTR szMsg ) { HRESULT hr = S_OK; char szMessage[DUTIL_STRING_BUFFER] = { }; hr = ::StringCchPrintfA(szMessage, countof(szMessage), "Assertion failed in %s, %i\n%s", szFile, iLine, szMsg); if (SUCCEEDED(hr)) { Dutil_AssertMsg(szMessage); } else { Dutil_AssertMsg("Assert failed to build string"); } }