📄 iceassert.h
字号:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Contains custom assertion code.
* \file IceAssert.h
* \author Pierre Terdiman
* \date January, 14, 2001
*/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Include Guard
#ifndef __ICEASSERT_H__
#define __ICEASSERT_H__
// Leave the {} so that you can write this kind of things safely in release mode:
// if(condition) ASSERT()
#ifndef ASSERT
#if defined( _DEBUG )
FUNCTION ICECORE_API bool CustomAssertFunction(int, char*, int, char*, bool&);
//! Custom ASSERT function. Various usages:
//! ASSERT(condition)
//! ASSERT(!"Not implemented")
//! ASSERT(condition && "error text")
#define ASSERT(exp) \
{ \
static bool IgnoreAlways = false; \
if(!IgnoreAlways) \
{ \
if(CustomAssertFunction((int)(exp), #exp, __LINE__, __FILE__, IgnoreAlways)) \
{ \
_asm { int 3 } \
} \
} \
}
#else
#define ASSERT(exp) {}
#endif
#endif
#ifndef assert
#define assert ASSERT
#endif
#define ICE_COMPILE_TIME_ASSERT(exp) extern char ICE_Dummy[ (exp) ? 1 : -1 ]
#endif // __ICEASSERT_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -