Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #pragma once
00013
00014 #include "buildver.h"
00015 #include "utilexp.h"
00016 #include "maxheap.h"
00017
00027 UtilExport int assert1(int line, char* file, char* function = NULL, char* expr = NULL );
00028
00029 #undef assert
00030
00031
00032
00033 #pragma deprecated("MaxAssert")
00034 #pragma deprecated("assert64")
00035 #pragma deprecated("DbgAssert64")
00036 #pragma deprecated("MaxAssert64")
00037
00062
00063 #if !defined( NDEBUG ) || defined( MAX_ASSERTS_ACTIVE_IN_RELEASE_BUILD )
00064 # define assert( expr ) ( (expr) || assert1( __LINE__, __FILE__, __FUNCTION__, (#expr) ) )
00065 # define DbgAssert( expr ) ( (expr) || assert1( __LINE__, __FILE__, __FUNCTION__, (#expr) ) )
00066 # define DbgVerify( expr ) ( (expr) || assert1( __LINE__, __FILE__, __FUNCTION__, (#expr) ) )
00067 # define MAX_ASSERTS_ACTIVE
00068 #else
00069 # define assert( expr ) ((void *)0)
00070 # define DbgAssert( expr )
00071 # define DbgVerify( expr ) ( expr )
00072 # undef MAX_ASSERTS_ACTIVE
00073 #endif
00074
00075
00076
00077
00085 class CAssertCB : public MaxHeapOperators
00086 {
00087 public:
00091 enum AssertResult
00092 {
00093 ASSERTCB_IGNORE,
00094 ASSERTCB_CANCEL,
00095 ASSERTCB_CONTINUE
00096 };
00097
00106 virtual AssertResult AssertEx(int line, char* file, char* function = NULL, char* expression = NULL) =0;
00107 };
00108
00122 UtilExport CAssertCB* SetAssertCB(CAssertCB* cb);
00123