/* * Copyright (C) 2005,2006,2007 MaNGOS * * 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 MANGOSSERVER_COMMON_H #define MANGOSSERVER_COMMON_H #include "Platform/Define.h" #if COMPILER == COMPILER_MICROSOFT #pragma warning(disable:4996) #ifndef __SHOW_STUPID_WARNINGS__ #pragma warning(disable:4244) #pragma warning(disable:4267) #pragma warning(disable:4800) #pragma warning(disable:4018) #pragma warning(disable:4311) #pragma warning(disable:4305) #pragma warning(disable:4005) #endif // __SHOW_STUPID_WARNINGS__ #endif // __GNUC__ // we need to stick to 1 version or half of the stuff will work for someone // others will not and opposite // will only support WoW and WoW:TBC 2.2.3 client build 7359... #define EXPECTED_MANGOS_CLIENT_BUILD {7359, 0} // must be the first thing to include for it to work #include "MemoryLeaks.h" #ifdef HAVE_CONFIG_H # include #endif #include "Utilities/HashMap.h" #include #include #include #include #include #include #include #if PLATFORM == PLATFORM_WIN32 #define STRCASECMP stricmp #else #define STRCASECMP strcasecmp #endif #include #include #include #include #include #include #include #include #include #include #include #if PLATFORM == PLATFORM_WIN32 # define FD_SETSIZE 1024 # include // XP winver - needed to compile with standard leak check in MemoryLeaks.h // uncomment later if needed //#define _WIN32_WINNT 0x0501 # include //#undef WIN32_WINNT #else # include # include # include # include # include # include #endif #if COMPILER == COMPILER_MICROSOFT #include #define I64FMT "%016I64X" #define I64FMTD "%I64u" #define SI64FMTD "%I64d" #define snprintf _snprintf #define atoll __atoi64 #define vsnprintf _vsnprintf #define strdup _strdup #define finite(X) _finite(X) #else #define stricmp strcasecmp #define strnicmp strncasecmp #define I64FMT "%016llX" #define I64FMTD "%llu" #define SI64FMTD "%lld" #endif #define GUID_HIPART(x) (uint32)((x) >> 32) #define GUID_LOPART(x) (uint32)((x) & 0xFFFFFFFFULL) #define MAKE_GUID(l, h) uint64( uint32(l) | ( uint64(h) << 32 ) ) #define atol(a) strtoul( a, NULL, 10) #define STRINGIZE(a) #a #define for if(true) for enum TimeConstants { MINUTE = 60, HOUR = MINUTE*60, DAY = HOUR*24, MONTH = DAY*30 }; enum AccountTypes { SEC_PLAYER = 0, SEC_MODERATOR = 1, SEC_GAMEMASTER = 2, SEC_ADMINISTRATOR = 3 }; enum LocaleConstant { LOCALE_ENG = 0, LOCALE_FR = 2, LOCALE_DE = 3, MAX_LOCALE = 8 }; #if PLATFORM == PLATFORM_WIN32 # define MANGOS_DLL_SPEC __declspec(dllexport) #else # define MANGOS_DLL_SPEC #endif // we always use stdlibc++ std::max/std::min, undefine some not C++ standart defines (Win API and some pother platforms) #ifdef max #undef max #endif #ifdef min #undef min #endif #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #endif