Skip to content

Commit

Permalink
Update libloading (#1355)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogoffart authored May 21, 2021
1 parent 080ffa5 commit c080390
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions glutin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ features = [
]

[target.'cfg(target_os = "windows")'.dependencies]
libloading = "0.6.1"
libloading = "0.7"
glutin_wgl_sys = { version = "0.1.4", path = "../glutin_wgl_sys" }
glutin_egl_sys = { version = "0.1.4", path = "../glutin_egl_sys" }
parking_lot = "0.11"
Expand All @@ -59,7 +59,7 @@ parking_lot = "0.11"
osmesa-sys = "0.1"
wayland-client = { version = "0.28", features = ["dlopen"], optional = true }
wayland-egl = { version = "0.28", optional = true }
libloading = "0.6.1"
libloading = "0.7"
glutin_egl_sys = { version = "0.1.4", path = "../glutin_egl_sys" }
glutin_glx_sys = { version = "0.1.6", path = "../glutin_glx_sys", optional = true }
parking_lot = "0.11"
Expand Down
8 changes: 5 additions & 3 deletions glutin/src/api/dlloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ impl<T: SymTrait> SymWrapper<T> {
for path in lib_paths {
// Avoid loading from PATH
#[cfg(target_os = "windows")]
let lib = windows::Library::load_with_flags(path, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)
.map(From::from);
let lib = unsafe {
windows::Library::load_with_flags(path, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)
.map(From::from)
};

#[cfg(not(target_os = "windows"))]
let lib = Library::new(path);
let lib = unsafe { Library::new(path) };

if lib.is_ok() {
return Ok(SymWrapper {
Expand Down

0 comments on commit c080390

Please sign in to comment.