Common.h
资源名称:wow.rar [点击查看]
上传用户:jxpjxmjjw
上传日期:2009-12-07
资源大小:5877k
文件大小:3k
源码类别:
模拟服务器
开发平台:
Visual C++
- // Copyright (C) 2004 Team Python
- //
- // This program is free software; you can redistribute it and/or modify
- // it under the terms of the GNU General Public License as published by
- // the Free Software Foundation; either version 2 of the License, or
- // (at your option) any later version.
- //
- // This program is distributed in the hope that it will be useful,
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- // GNU General Public License for more details.
- //
- // You should have received a copy of the GNU General Public License
- // along with this program; if not, write to the Free Software
- // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- #ifndef WOWPYTHONSERVER_COMMON_H
- #define WOWPYTHONSERVER_COMMON_H
- // Only clients with this version will be allowed to view the realmlist.
- // Higher versions will be rejected, lower versions will be patched if possible.
- #define EXPECTED_WOW_CLIENT_BUILD 3925//3807//3734//3712//3702//3694//3810//3892
- #ifdef HAVE_CONFIG_H
- # include <config.h>
- #endif
- #include <stdio.h>
- #include <stdlib.h>
- // current platform and compiler
- #define PLATFORM_WIN32 0
- #define PLATFORM_UNIX 1
- #define PLATFORM_APPLE 2
- #if defined( __WIN32__ ) || defined( WIN32 ) || defined( _WIN32 )
- # define PLATFORM PLATFORM_WIN32
- #elif defined( __APPLE_CC__ )
- # define PLATFORM PLATFORM_APPLE
- #else
- # define PLATFORM PLATFORM_UNIX
- #endif
- #define COMPILER_MICROSOFT 0
- #define COMPILER_GNU 1
- #define COMPILER_BORLAND 2
- #ifdef _MSC_VER
- # define COMPILER COMPILER_MICROSOFT
- #elif defined( __BORLANDC__ )
- # define COMPILER COMPILER_BORLAND
- #elif defined( __GNUC__ )
- # define COMPILER COMPILER_GNU
- #else
- # pragma error "FATAL ERROR: Unknown compiler."
- #endif
- #if COMPILER == COMPILER_MICROSOFT
- # pragma warning( disable : 4267 ) // conversion from 'size_t' to 'int', possible loss of data
- # pragma warning( disable : 4786 ) // identifier was truncated to '255' characters in the debug information
- #endif
- #if PLATFORM == PLATFORM_WIN32
- #define STRCASECMP stricmp
- #else
- #define STRCASECMP strcasecmp
- #endif
- #include <set>
- #include <list>
- #include <string>
- #include <map>
- #include <sstream>
- #include <algorithm>
- #include "MemoryLeaks.h"
- #if COMPILER == COMPILER_MICROSOFT
- typedef __int64 int64;
- #else
- typedef long long int64;
- #endif
- typedef long int32;
- typedef short int16;
- typedef char int8;
- #if COMPILER == COMPILER_MICROSOFT
- typedef unsigned __int64 uint64;
- #else
- typedef unsigned long long uint64;
- typedef unsigned long DWORD;
- #endif
- typedef unsigned long uint32;
- typedef unsigned short uint16;
- typedef unsigned char uint8;
- #define atol(a) strtoul( a, NULL, 10)
- #define STRINGIZE(a) #a
- // fix buggy MSVC's for variable scoping to be reliable =S
- #define for if(true) for
- #endif