Added overloaded LoadArchSpecificWindowsDll, to help addins load native libraries.

sedebug
Diva Canto 2015-01-04 19:06:49 -08:00
parent 5179f078f7
commit ce1a87b784
1 changed files with 7 additions and 2 deletions

View File

@ -537,6 +537,11 @@ namespace OpenSim.Framework
} }
public static bool LoadArchSpecificWindowsDll(string libraryName) 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 // 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 // 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; string nativeLibraryPath;
if (Util.Is64BitProcess()) if (Util.Is64BitProcess())
nativeLibraryPath = "lib64/" + libraryName; nativeLibraryPath = Path.Combine(Path.Combine(path, "lib64"), libraryName);
else else
nativeLibraryPath = "lib32/" + libraryName; nativeLibraryPath = Path.Combine(Path.Combine(path, "lib32"), libraryName);
m_log.DebugFormat("[UTIL]: Loading native Windows library at {0}", nativeLibraryPath); m_log.DebugFormat("[UTIL]: Loading native Windows library at {0}", nativeLibraryPath);