Merge pull request #27 from cra0zy/glob

Add RTLD_GLOBAL flag
This commit is contained in:
Harry 2018-03-03 15:41:44 +01:00 committed by GitHub
commit 1ee1ccdfef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,6 +33,9 @@ class FuncLoader
[DllImport("libc")] [DllImport("libc")]
private static extern int uname(IntPtr buf); private static extern int uname(IntPtr buf);
private const int RTLD_LAZY = 0x0001;
private const int RTLD_GLOBAL = 0x0100;
public static bool IsWindows, IsOSX; public static bool IsWindows, IsOSX;
static FuncLoader() static FuncLoader()
@ -69,9 +72,9 @@ class FuncLoader
return Windows.LoadLibraryW(libname); return Windows.LoadLibraryW(libname);
if (IsOSX) if (IsOSX)
return OSX.dlopen(libname, 1); return OSX.dlopen(libname, RTLD_GLOBAL | RTLD_LAZY);
return Linux.dlopen(libname, 1); return Linux.dlopen(libname, RTLD_GLOBAL | RTLD_LAZY);
} }
public static IntPtr GetProcAddress(IntPtr library, string function) public static IntPtr GetProcAddress(IntPtr library, string function)