1 内存管理
//根据指针值删除内存
#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
2类型管理
///
//标准数据类型定义
///
#define VOID void //标准空
typedef unsigned char UCHAR; //标准无符号CHAR
typedef char CHAR; //标准CHAR
typedef unsigned int UINT; //标准无符号INT
typedef int INT; //标准INT
typedef unsigned short USHORT; //标准无符号short
typedef short SHORT; //标准short
typedef unsigned long ULONG; //标准无符号LONG(不推荐使用)
typedef long LONG; //标准LONG(不推荐使用)
typedef float FLOAT; //标准float
typedef UCHAR uchar;
typedef USHORT ushort;
typedef UINT uint;
typedef ULONG ulong;
typedef ULONG IP_t;
typedef USHORT PacketID_t;
typedef INT BOOL;
typedef UCHAR BYTE;