From ce1a87b7843ed05e8d827c230c9860e7bf7d75b6 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 4 Jan 2015 19:06:49 -0800 Subject: [PATCH] Added overloaded LoadArchSpecificWindowsDll, to help addins load native libraries. --- OpenSim/Framework/Util.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 6f2e7c3e24..836fa5fcaa 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -537,6 +537,11 @@ namespace OpenSim.Framework } public static bool LoadArchSpecificWindowsDll(string libraryName) + { + return LoadArchSpecificWindowsDll(libraryName, string.Empty); + } + + public static bool LoadArchSpecificWindowsDll(string libraryName, string path) { // We do this so that OpenSimulator on Windows loads the correct native library depending on whether // it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports @@ -547,9 +552,9 @@ namespace OpenSim.Framework string nativeLibraryPath; if (Util.Is64BitProcess()) - nativeLibraryPath = "lib64/" + libraryName; + nativeLibraryPath = Path.Combine(Path.Combine(path, "lib64"), libraryName); else - nativeLibraryPath = "lib32/" + libraryName; + nativeLibraryPath = Path.Combine(Path.Combine(path, "lib32"), libraryName); m_log.DebugFormat("[UTIL]: Loading native Windows library at {0}", nativeLibraryPath);