aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorS.V <svranesevic@users.noreply.github.com>2017-03-31 23:10:18 +0200
committerShauren <shauren.trinity@gmail.com>2017-03-31 23:10:18 +0200
commitf3d795d8ddd54c7def3e2119cec1abe5c69b43f9 (patch)
treea63be59c97ee5316b62e7eac452e417beb14923e /src
parentb9d456fad1e39943502218b3fe065be36810e139 (diff)
Core/ScriptReloadMgr: Fixed scripts hot swapping on OS X (#19365)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Scripting/ScriptReloadMgr.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/server/game/Scripting/ScriptReloadMgr.cpp b/src/server/game/Scripting/ScriptReloadMgr.cpp
index 9ef0c7681d5..72f935e5cd1 100644
--- a/src/server/game/Scripting/ScriptReloadMgr.cpp
+++ b/src/server/game/Scripting/ScriptReloadMgr.cpp
@@ -67,6 +67,9 @@ namespace fs = boost::filesystem;
#ifdef _WIN32
#include <windows.h>
#define HOTSWAP_PLATFORM_REQUIRES_CACHING
+#elif __APPLE__
+ #include <dlfcn.h>
+ #define HOTSWAP_PLATFORM_REQUIRES_CACHING
#else // Posix
#include <dlfcn.h>
// #define HOTSWAP_PLATFORM_REQUIRES_CACHING
@@ -87,11 +90,13 @@ static char const* GetSharedLibraryPrefix()
#endif
}
-// Returns "dll" on Windows and "so" on posix.
+// Returns "dll" on Windows, "dylib" on OS X, and "so" on posix.
static char const* GetSharedLibraryExtension()
{
#ifdef _WIN32
return "dll";
+#elif __APPLE__
+ return "dylib";
#else // Posix
return "so";
#endif
@@ -112,7 +117,7 @@ static fs::path GetDirectoryOfExecutable()
if (path.is_absolute())
return path.parent_path();
else
- return fs::absolute(path).parent_path();
+ return fs::canonical(fs::absolute(path)).parent_path();
}
class SharedLibraryUnloader