Changeset 606 for trunk/Utilities


Ignore:
Timestamp:
Mar 30, 2016, 7:36:19 AM (8 years ago)
Author:
roman
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/Miscellaneous/AtlReleaseTrace/roatlreleasetrace.h

    r421 r606  
    88#pragma once
    99
     10#include <math.h>
    1011#include <atlstr.h>
     12
     13using namespace ATL;
    1114
    1215////////////////////////////////////////////////////////////
     
    210213// ATLASSERT, ATLVERIFY
    211214
     215__forceinline VOID AtlAssert(BOOL bResult, LPCSTR pszFile, INT nLine, LPCSTR pszFunction, LPCSTR pszExpression)
     216{
     217        if(bResult)
     218                return;
     219        _ATLTRY
     220        {
     221                _Z1(atlTraceException, 1, _T("Assertion failed: %hs\n") _T("%hs(%d): Assertion failed in function %hs\n"), pszExpression, pszFile, nLine, pszFunction);
     222                AtlThrow(E_FAIL);
     223        }
     224        _ATLCATCHALL()
     225        {
     226        }
     227}
     228
    212229#undef ATLASSERT
    213230#undef ATLVERIFY
    214 #define ATLASSERT(x)    { const BOOL bAssertValue = (x) != 0; if(!bAssertValue) { _ATLTRY { _Z1(atlTraceException, 1, _T("Assertion failed: %hs\n"), #x); AtlThrow(E_FAIL); } _ATLCATCHALL() { } } }
     231#define ATLASSERT(x)    AtlAssert((x) != 0, __FILE__, __LINE__, __FUNCTION__, #x);
    215232#define ATLVERIFY(x)    ATLASSERT(x)
    216233
    217234#define _A              ATLASSERT
    218235#define _W              ATLVERIFY
     236
     237#undef _ASSERT
     238#define _ASSERT ATLASSERT
    219239
    220240////////////////////////////////////////////////////////////
     
    275295};
    276296
     297#undef _Y1
     298#undef _Y2
    277299#define _Y1     CDebugTraceContext DebugTraceContext(__FILE__, __LINE__, __FUNCTION__); DebugTraceContext
    278300#define _Y2 DebugTraceContext.Terminate
Note: See TracChangeset for help on using the changeset viewer.