15 Star 25 Fork 3

eclipser / thread

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Common.h 905 Bytes
一键复制 编辑 原始数据 按行查看 历史
Administrator 提交于 2014-01-17 16:44 . 导入断言,日志等
/*
* File: Common.h
* Author: Vicky.H
* Email: eclipser@163.com
*
* Created on 2014年1月16日, 下午10:46
*/
#ifndef CN_VICKY__COMMON_H
#define CN_VICKY__COMMON_H
#include "Assertx.h"
//无效的ID值
#define INVALID_ID -1
#define __ENTER_FUNCTION {try{
#define __LEAVE_FUNCTION }catch(...){AssertSpecial(false,__PRETTY_FUNCTION__);}}
//根据指针值删除内存
#ifndef SAFE_DELETE
#define SAFE_DELETE(x) if( (x)!=NULL ) { delete (x); (x)=NULL; }
#endif
//根据指针值删除数组类型内存
#ifndef SAFE_DELETE_ARRAY
#define SAFE_DELETE_ARRAY(x) if( (x)!=NULL ) { delete[] (x); (x)=NULL; }
#endif
//根据指针调用free接口
#ifndef SAFE_FREE
#define SAFE_FREE(x) if( (x)!=NULL ) { free(x); (x)=NULL; }
#endif
//根据指针调用Release接口
#ifndef SAFE_RELEASE
#define SAFE_RELEASE(x) if( (x)!=NULL ) { (x)->Release(); (x)=NULL; }
#endif
#endif /* CN_VICKY__COMMON_H */
C++
1
https://gitee.com/eclipser/thread.git
git@gitee.com:eclipser/thread.git
eclipser
thread
thread
master

搜索帮助