这部分c++ 调试支持代码是什么意思,能解释下吗?

来源:百度知道 编辑:UC知道 时间:2024/06/07 15:39:37
#define AfxDebugBreak() _asm { int 3 }
#ifdef _DEBUG

void __cdecl AfxTrace(LPCTSTR lpszFormat, ...);
#define TRACE ::AfxTrace
#define ASSERT(f) \
if (!(f)) \
AfxDebugBreak();
#define VERIFY(f) ASSERT(f)

#else // _DEBUG

#define ASSERT(f) ((void)0)
#define VERIFY(f) ((void)(f))
inline void __cdecl AfxTrace(LPCTSTR, ...) { }
#define TRACE (void)0

#endif // _DEBUG

#ifdef _DEBUG //如果定义了_DEBUG,则……
void __cdecl AfxTrace(LPCTSTR lpszFormat, ...);
#define TRACE ::AfxTrace
#define ASSERT(f) \
if (!(f)) \
AfxDebugBreak();
#define VERIFY(f) ASSERT(f) // 这样声明,及宏定义

#else // _DEBUG//如果没有定义_DEBUG,则……

#endif // _DEBUG

也就是你想要调试的时候,在文件头输入 #define _DEBUG
那么根据这个调试支持代码就可以对有关的函数及宏定义 定义成调试下的值。

不需要调试,把#define _DEBUG
注释掉就可以了