private static IDisposable DetermineNativeBinder() { var path = FindNativeLibPath(); if (PlatformApis.IsWindows()) { return(new WindowsNativeBinder(path)); } return(new UnixNativeBinder(path)); }
private static string FindPlatformSpecificNativeFilePath(string dir) { var path = dir; if (PlatformApis.IsDarwin()) { path = Path.Combine(path, "liblmdb.dylib"); } else if (PlatformApis.IsWindows()) { path = Path.Combine(path, IntPtr.Size == 4 ? "lmdb32.dll" : "lmdb64.dll"); } else { path = "liblmdb.so"; } return(path); }