⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 myassert.h

📁 跨操作系统的微型中间件
💻 H
字号:
#ifndef _MYASSERT_H_#define _MYASSERT_H_#include <stdio.h>
#include <assert.h>


#ifdef __cplusplus
extern "C" {
#endif


#if ASSERT      #define Assert(condition)    {                              \        if (!(condition))                                       \        {                                                       \            printf("_Assert: %s, %d",__FILE__, __LINE__ );		\		}														\
		assert(condition); }    #define AssertV(condition,errNo)    {                                   \        if (!(condition))                                                   \        {                                                                   \            printf("_AssertV: %s, %d (%d)",__FILE__, __LINE__, errNo );    \        }
	#define AssertV2(condition,msg)    {                                   \
		if (!(condition))                                                   \
		{                                                                   \
			printf("_AssertV: %s, %d (%s)",__FILE__, __LINE__, msg );    \
		}																	\
		assert(condition); }

	    #define Warn(condition) {                                       \            if (!(condition))                                       \                printf( "_Warn: %s, %d\n",__FILE__, __LINE__ );     }                                                                                                        #define WarnV(condition,msg)        {                               \        if (!(condition))                                               \            printf ("_WarnV: %s, %d (%s)\n",__FILE__, __LINE__, msg );  }                                                                                                #define WarnVE(condition,msg,err)  {                           		\        if (!(condition))                                               \        {   char buffer[kAssertBuffSize];								\            buffer[kAssertBuffSize -1] = 0;                              \            printf ("_WarnV: %s, %d (%s, %s [err=%d])\n",__FILE__, __LINE__, msg, qtss_strerror(err,buffer,sizeof(buffer) -1), err );  \        }	}#else                #define Assert(condition) ((void) 0)    #define AssertV(condition,errNo) ((void) 0)    #define Warn(condition) ((void) 0)    #define WarnV(condition,msg) ((void) 0)#endif


#ifdef __cplusplus
}
#endif
#endif //_MY_ASSERT_H_

⌨️ 快捷键说明

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