assert.h

来自「小型的3D游戏引擎」· C头文件 代码 · 共 32 行

H
32
字号
/********************************************************************
	created:		?
	author:			Steve Rabin, Game Programming Gems
	copyright:		Copyright 2003 (C) Steve Rabin
	description:	Assert function
*********************************************************************/

#ifndef _ASSERT_H_
#define _ASSERT_H_
#include <stdio.h>
#include <stdarg.h>
#include <windows.h>

#ifdef _DEBUG
extern bool _DebugAssert( int expression, char * description, int line, char * file, bool & ignoreAlways );

#define assertex( exp ) \
   {  static bool ignoreAlways = false; \
		if( !ignoreAlways ) \
		{ \
			if( _DebugAssert( (int)(exp), #exp, __LINE__, __FILE__, ignoreAlways ) ) \
			{ _asm { int 3 } } \
		} \
   }

#else
#define assertex( exp )
#endif 



#endif /* _ASSERT_H_ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?