102 lines
2.3 KiB
C++
102 lines
2.3 KiB
C++
#ifndef _types_H_
|
|
#define _types_H_
|
|
|
|
//////////////////////////////////////////////////////////////
|
|
#include <assert.h>
|
|
#include <string>
|
|
#include <cstring>
|
|
|
|
#ifndef ASSERT
|
|
#define ASSERT(f) assert(f)
|
|
#endif
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
typedef signed char int8;
|
|
typedef signed short int16;
|
|
typedef signed int int32;
|
|
|
|
typedef unsigned char uint8;
|
|
typedef unsigned short uint16;
|
|
typedef unsigned int uint32;
|
|
|
|
typedef unsigned char uint8;
|
|
typedef unsigned int uint;
|
|
typedef unsigned short uint16;
|
|
typedef unsigned int uint32;
|
|
|
|
#if (CC_TARGET_PLATFORM==CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
|
//#define SCORE long long
|
|
#define SCORE int
|
|
#elif (CC_TARGET_PLATFORM==CC_PLATFORM_IOS)
|
|
#define SCORE int
|
|
#endif
|
|
|
|
#define TRUE 1
|
|
#define FALSE 0
|
|
|
|
typedef wchar_t wchar;
|
|
|
|
#ifdef _UNICODE
|
|
typedef std::wstring tstring;
|
|
typedef wchar tchar;
|
|
#else
|
|
typedef std::string tstring;
|
|
typedef char tchar;
|
|
#endif
|
|
|
|
#ifdef _WIN32
|
|
#define LLSTRING "%I64d"
|
|
#else
|
|
#define LLSTRING "%lld"
|
|
#endif
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
// 宏定义
|
|
#define countarray(ary) (sizeof(ary)/sizeof(ary[0]))
|
|
#define zeromemory(x, size) memset(x, 0, size)
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef WIN32
|
|
//对应数据类型
|
|
typedef unsigned char BYTE;
|
|
typedef unsigned short WORD;
|
|
typedef unsigned int DWORD;
|
|
typedef unsigned short TCHAR;
|
|
typedef unsigned int UINT;
|
|
|
|
typedef double DOUBLE;
|
|
typedef short SHORT;
|
|
typedef int INT;
|
|
typedef float FLOAT;
|
|
typedef DWORD COLORREF;
|
|
|
|
typedef int LONG;
|
|
|
|
typedef struct _SYSTEMTIME
|
|
{
|
|
WORD wYear;
|
|
WORD wMonth;
|
|
WORD wDayOfWeek;
|
|
WORD wDay;
|
|
WORD wHour;
|
|
WORD wMinute;
|
|
WORD wSecond;
|
|
WORD wMilliseconds;
|
|
} SYSTEMTIME;
|
|
|
|
|
|
//兼容PC函数
|
|
#define CopyMemory(des,src,size_t) memcpy(des,src,size_t)
|
|
#define VERIFY(e) assert(e)
|
|
#define LOBYTE(w) ((BYTE)(((DWORD)(w)) & 0xff))
|
|
#define HIBYTE(w) ((BYTE)((((DWORD)(w)) >> 8) & 0xff))
|
|
#define __max(a,b) (((a) > (b)) ? (a) : (b))
|
|
#define __min(a,b) (((a) < (b)) ? (a) : (b))
|
|
#endif
|
|
|
|
#include <stdio.h>
|
|
#include <stdarg.h>
|
|
|
|
#endif // _types_H_
|