From 9939cb3834ff1320210931038de08537ab227c54 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Mon, 29 May 2017 20:59:04 +0300 Subject: [PATCH] Fix TC build --- LuaEngine.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/LuaEngine.cpp b/LuaEngine.cpp index 25a42b9..75c12f9 100644 --- a/LuaEngine.cpp +++ b/LuaEngine.cpp @@ -14,6 +14,18 @@ #include "ElunaCreatureAI.h" #include "ElunaInstanceAI.h" +#if defined(TRINITY_PLATFORM) && defined(TRINITY_PLATFORM_WINDOWS) +#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS +#define ELUNA_WINDOWS +#endif +#elif defined(PLATFORM) && defined(PLATFORM_WINDOWS) +#if PLATFORM == PLATFORM_WINDOWS +#define ELUNA_WINDOWS +#endif +#else +#error Eluna could not determine platform +#endif + // Some dummy includes containing BOOST_VERSION: // ObjectAccessor.h Config.h Log.h #ifndef MANGOS @@ -92,7 +104,7 @@ void Eluna::LoadScriptPaths() lua_extensions.clear(); lua_folderpath = eConfigMgr->GetStringDefault("Eluna.ScriptPath", "lua_scripts"); -#if PLATFORM == PLATFORM_UNIX || PLATFORM == PLATFORM_APPLE +#ifndef ELUNA_WINDOWS if (lua_folderpath[0] == '~') if (const char* home = getenv("HOME")) lua_folderpath.replace(0, 1, home); @@ -382,7 +394,7 @@ void Eluna::GetScripts(std::string path) std::string fullpath = dir_iter->path().generic_string(); // Check if file is hidden -#if PLATFORM == PLATFORM_WINDOWS +#ifdef ELUNA_WINDOWS DWORD dwAttrib = GetFileAttributes(fullpath.c_str()); if (dwAttrib != INVALID_FILE_ATTRIBUTES && (dwAttrib & FILE_ATTRIBUTE_HIDDEN)) continue; @@ -429,7 +441,7 @@ void Eluna::GetScripts(std::string path) std::string fullpath = path + "/" + directory->d_name; // Check if file is hidden -#if PLATFORM == PLATFORM_WINDOWS +#ifdef ELUNA_WINDOWS DWORD dwAttrib = GetFileAttributes(fullpath.c_str()); if (dwAttrib != INVALID_FILE_ATTRIBUTES && (dwAttrib & FILE_ATTRIBUTE_HIDDEN)) continue;