diff --git a/src/common/Common.h b/src/common/Common.h index ad353ac23..3e1f698ef 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -60,7 +60,7 @@ #include #include -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS #define STRCASECMP stricmp #else #define STRCASECMP strcasecmp @@ -86,7 +86,7 @@ #include #include -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS # include // XP winver - needed to compile with standard leak check in MemoryLeaks.h // uncomment later if needed @@ -102,7 +102,7 @@ # include #endif -#if COMPILER == COMPILER_MICROSOFT +#if AC_COMPILER == AC_COMPILER_MICROSOFT #include diff --git a/src/common/CompilerDefs.h b/src/common/CompilerDefs.h index e79f65dde..772a39e4e 100644 --- a/src/common/CompilerDefs.h +++ b/src/common/CompilerDefs.h @@ -7,38 +7,38 @@ #ifndef TRINITY_COMPILERDEFS_H #define TRINITY_COMPILERDEFS_H -#define PLATFORM_WINDOWS 0 -#define PLATFORM_UNIX 1 -#define PLATFORM_APPLE 2 -#define PLATFORM_INTEL 3 +#define AC_PLATFORM_WINDOWS 0 +#define AC_PLATFORM_UNIX 1 +#define AC_PLATFORM_APPLE 2 +#define AC_PLATFORM_INTEL 3 // must be first (win 64 also define _WIN32) #if defined( _WIN64 ) -# define PLATFORM PLATFORM_WINDOWS +#define AC_PLATFORM AC_PLATFORM_WINDOWS #elif defined( __WIN32__ ) || defined( WIN32 ) || defined( _WIN32 ) -# define PLATFORM PLATFORM_WINDOWS +#define AC_PLATFORM AC_PLATFORM_WINDOWS #elif defined( __APPLE_CC__ ) -# define PLATFORM PLATFORM_APPLE +#define AC_PLATFORM AC_PLATFORM_APPLE #elif defined( __INTEL_COMPILER ) -# define PLATFORM PLATFORM_INTEL +#define AC_PLATFORM AC_PLATFORM_INTEL #else -# define PLATFORM PLATFORM_UNIX +#define AC_PLATFORM AC_PLATFORM_UNIX #endif -#define COMPILER_MICROSOFT 0 -#define COMPILER_GNU 1 -#define COMPILER_BORLAND 2 -#define COMPILER_INTEL 3 +#define AC_COMPILER_MICROSOFT 0 +#define AC_COMPILER_GNU 1 +#define AC_COMPILER_BORLAND 2 +#define AC_COMPILER_INTEL 3 #ifdef _MSC_VER -# define COMPILER COMPILER_MICROSOFT +#define AC_COMPILER AC_COMPILER_MICROSOFT #elif defined( __BORLANDC__ ) -# define COMPILER COMPILER_BORLAND +#define AC_COMPILER AC_COMPILER_BORLAND #elif defined( __INTEL_COMPILER ) -# define COMPILER COMPILER_INTEL +#define AC_COMPILER AC_COMPILER_INTEL #elif defined( __GNUC__ ) -# define COMPILER COMPILER_GNU -# define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#define AC_COMPILER AC_COMPILER_GNU +#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) #else # error "FATAL ERROR: Unknown compiler." #endif diff --git a/src/common/Debugging/Errors.cpp b/src/common/Debugging/Errors.cpp index 4c97ceb67..c7e78b838 100644 --- a/src/common/Debugging/Errors.cpp +++ b/src/common/Debugging/Errors.cpp @@ -22,7 +22,7 @@ terminates the application. */ -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS #include #define Crash(message) \ ULONG_PTR execeptionArgs[] = { reinterpret_cast(strdup(message)), reinterpret_cast(_ReturnAddress()) }; \ diff --git a/src/common/Debugging/Errors.h b/src/common/Debugging/Errors.h index 00ca02c1e..1edfdcb75 100644 --- a/src/common/Debugging/Errors.h +++ b/src/common/Debugging/Errors.h @@ -29,7 +29,7 @@ namespace Trinity std::string GetDebugInfo(); -#if COMPILER == COMPILER_MICROSOFT +#if AC_COMPILER == AC_COMPILER_MICROSOFT #define ASSERT_BEGIN __pragma(warning(push)) __pragma(warning(disable: 4127)) #define ASSERT_END __pragma(warning(pop)) #else @@ -37,7 +37,7 @@ std::string GetDebugInfo(); #define ASSERT_END #endif -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS #define EXCEPTION_ASSERTION_FAILURE 0xC0000420L #endif diff --git a/src/common/Debugging/WheatyExceptionReport.cpp b/src/common/Debugging/WheatyExceptionReport.cpp index db4bae02f..0f49eb87c 100644 --- a/src/common/Debugging/WheatyExceptionReport.cpp +++ b/src/common/Debugging/WheatyExceptionReport.cpp @@ -5,7 +5,7 @@ //========================================== #include "CompilerDefs.h" -#if PLATFORM == PLATFORM_WINDOWS && !defined(__MINGW32__) +#if AC_PLATFORM == AC_PLATFORM_WINDOWS && !defined(__MINGW32__) #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif diff --git a/src/common/Debugging/WheatyExceptionReport.h b/src/common/Debugging/WheatyExceptionReport.h index a8fc2970d..18f1e43b4 100644 --- a/src/common/Debugging/WheatyExceptionReport.h +++ b/src/common/Debugging/WheatyExceptionReport.h @@ -1,7 +1,7 @@ #ifndef _WHEATYEXCEPTIONREPORT_ #define _WHEATYEXCEPTIONREPORT_ -#if PLATFORM == PLATFORM_WINDOWS && !defined(__MINGW32__) +#if AC_PLATFORM == AC_PLATFORM_WINDOWS && !defined(__MINGW32__) #include #include diff --git a/src/common/Define.h b/src/common/Define.h index d7a057475..d7d1fcfff 100644 --- a/src/common/Define.h +++ b/src/common/Define.h @@ -13,11 +13,8 @@ #include #include #include - #include "CompilerDefs.h" - - #if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__) #define OS_WIN #endif @@ -33,7 +30,7 @@ # endif //ACE_BYTE_ORDER #endif //TRINITY_ENDIAN -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS # define TRINITY_PATH_MAX MAX_PATH # ifndef DECLSPEC_NORETURN # define DECLSPEC_NORETURN __declspec(noreturn) @@ -41,11 +38,11 @@ # ifndef DECLSPEC_DEPRECATED # define DECLSPEC_DEPRECATED __declspec(deprecated) # endif //DECLSPEC_DEPRECATED -#else //PLATFORM != PLATFORM_WINDOWS +#else //AC_PLATFORM != AC_PLATFORM_WINDOWS # define TRINITY_PATH_MAX PATH_MAX # define DECLSPEC_NORETURN # define DECLSPEC_DEPRECATED -#endif //PLATFORM +#endif //AC_PLATFORM #if !defined(COREDEBUG) # define TRINITY_INLINE inline @@ -56,15 +53,15 @@ # define TRINITY_INLINE #endif //!COREDEBUG -#if COMPILER == COMPILER_GNU +#if AC_COMPILER == AC_COMPILER_GNU # define ATTR_NORETURN __attribute__((noreturn)) # define ATTR_PRINTF(F, V) __attribute__ ((format (printf, F, V))) # define ATTR_DEPRECATED __attribute__((deprecated)) -#else //COMPILER != COMPILER_GNU +#else //AC_COMPILER != AC_COMPILER_GNU # define ATTR_NORETURN # define ATTR_PRINTF(F, V) # define ATTR_DEPRECATED -#endif //COMPILER == COMPILER_GNU +#endif //AC_COMPILER == AC_COMPILER_GNU #define UI64FMTD ACE_UINT64_FORMAT_SPECIFIER #define UI64LIT(N) ACE_UINT64_LITERAL(N) diff --git a/src/common/GitRevision.cpp b/src/common/GitRevision.cpp index 3bec36340..1a8df7cd8 100644 --- a/src/common/GitRevision.cpp +++ b/src/common/GitRevision.cpp @@ -21,13 +21,13 @@ char const* GitRevision::GetBranch() return _BRANCH; } -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS # ifdef _WIN64 # define AZEROTH_PLATFORM_STR "Win64" # else # define AZEROTH_PLATFORM_STR "Win32" # endif -#else // PLATFORM +#else // AC_PLATFORM # define AZEROTH_PLATFORM_STR "Unix" #endif diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp index 148e81899..7f5847710 100644 --- a/src/common/Logging/Log.cpp +++ b/src/common/Logging/Log.cpp @@ -248,7 +248,7 @@ void Log::InitColors(const std::string& str) void Log::SetColor(bool stdout_stream, ColorTypes color) { - #if PLATFORM == PLATFORM_WINDOWS + #if AC_PLATFORM == AC_PLATFORM_WINDOWS static WORD WinColorFG[Colors] = { 0, // BLACK @@ -322,7 +322,7 @@ void Log::SetColor(bool stdout_stream, ColorTypes color) void Log::ResetColor(bool stdout_stream) { - #if PLATFORM == PLATFORM_WINDOWS + #if AC_PLATFORM == AC_PLATFORM_WINDOWS HANDLE hConsole = GetStdHandle(stdout_stream ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE ); SetConsoleTextAttribute(hConsole, FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED ); #else diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp index 8fed7c8cf..c960384fd 100644 --- a/src/common/Utilities/Util.cpp +++ b/src/common/Utilities/Util.cpp @@ -447,7 +447,7 @@ std::wstring GetMainPartOfName(std::wstring wname, uint32 declension) bool utf8ToConsole(const std::string& utf8str, std::string& conStr) { -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS std::wstring wstr; if (!Utf8toWStr(utf8str, wstr)) return false; @@ -464,7 +464,7 @@ bool utf8ToConsole(const std::string& utf8str, std::string& conStr) bool consoleToUtf8(const std::string& conStr, std::string& utf8str) { -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS std::wstring wstr; wstr.resize(conStr.size()); OemToCharBuffW(&conStr[0], &wstr[0], conStr.size()); @@ -503,7 +503,7 @@ void utf8printf(FILE* out, const char *str, ...) void vutf8printf(FILE* out, const char *str, va_list* ap) { -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS char temp_buf[32*1024]; wchar_t wtemp_buf[32*1024]; diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 55d1a3e64..d6ccdd7af 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -417,7 +417,7 @@ void World::LoadModuleConfigSettings() std::string conf_path = _CONF_DIR; std::string cfg_file = conf_path + "/" + configFile; -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS cfg_file = configFile; #endif std::string cfg_def_file = cfg_file + ".dist"; @@ -1197,7 +1197,7 @@ void World::LoadConfigSettings(bool reload) if (dataPath.empty() || (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\')) dataPath.push_back('/'); -#if PLATFORM == PLATFORM_UNIX || PLATFORM == PLATFORM_APPLE +#if AC_PLATFORM == AC_PLATFORM_UNIX || AC_PLATFORM == AC_PLATFORM_APPLE if (dataPath[0] == '~') { const char* home = getenv("HOME"); diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index fa18491b7..c7d51959e 100644 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -23,7 +23,7 @@ #include "Player.h" #include "Util.h" -#if PLATFORM != PLATFORM_WINDOWS +#if AC_PLATFORM != AC_PLATFORM_WINDOWS #include #include @@ -79,7 +79,7 @@ int cli_hook_func() void utf8print(void* /*arg*/, const char* str) { -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS wchar_t wtemp_buf[6000]; size_t wtemp_len = 6000-1; if (!Utf8toWStr(str, strlen(str), wtemp_buf, wtemp_len)) @@ -122,7 +122,7 @@ void CliRunnable::run() { ///- Display the list of available CLI functions then beep //TC_LOG_INFO("server.worldserver", ""); -#if PLATFORM != PLATFORM_WINDOWS +#if AC_PLATFORM != AC_PLATFORM_WINDOWS rl_attempted_completion_function = cli_completion; rl_event_hook = cli_hook_func; #endif @@ -141,7 +141,7 @@ void CliRunnable::run() char *command_str ; // = fgets(commandbuf, sizeof(commandbuf), stdin); -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS char commandbuf[256]; command_str = fgets(commandbuf, sizeof(commandbuf), stdin); #else @@ -160,7 +160,7 @@ void CliRunnable::run() if (!*command_str) { -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS printf("AC>"); #else free(command_str); @@ -171,7 +171,7 @@ void CliRunnable::run() std::string command; if (!consoleToUtf8(command_str, command)) // convert from console encoding to utf8 { -#if PLATFORM == PLATFORM_WINDOWS +#if AC_PLATFORM == AC_PLATFORM_WINDOWS printf("AC>"); #else free(command_str); @@ -181,7 +181,7 @@ void CliRunnable::run() fflush(stdout); sWorld->QueueCliCommand(new CliCommandHolder(NULL, command.c_str(), &utf8print, &commandFinished)); -#if PLATFORM != PLATFORM_WINDOWS +#if AC_PLATFORM != AC_PLATFORM_WINDOWS add_history(command.c_str()); free(command_str); #endif