Skip to content

Commit c080390

Browse files
authored
Update libloading (#1355)
1 parent 080ffa5 commit c080390

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

glutin/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ features = [
5050
]
5151

5252
[target.'cfg(target_os = "windows")'.dependencies]
53-
libloading = "0.6.1"
53+
libloading = "0.7"
5454
glutin_wgl_sys = { version = "0.1.4", path = "../glutin_wgl_sys" }
5555
glutin_egl_sys = { version = "0.1.4", path = "../glutin_egl_sys" }
5656
parking_lot = "0.11"
@@ -59,7 +59,7 @@ parking_lot = "0.11"
5959
osmesa-sys = "0.1"
6060
wayland-client = { version = "0.28", features = ["dlopen"], optional = true }
6161
wayland-egl = { version = "0.28", optional = true }
62-
libloading = "0.6.1"
62+
libloading = "0.7"
6363
glutin_egl_sys = { version = "0.1.4", path = "../glutin_egl_sys" }
6464
glutin_glx_sys = { version = "0.1.6", path = "../glutin_glx_sys", optional = true }
6565
parking_lot = "0.11"

glutin/src/api/dlloader.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ impl<T: SymTrait> SymWrapper<T> {
3333
for path in lib_paths {
3434
// Avoid loading from PATH
3535
#[cfg(target_os = "windows")]
36-
let lib = windows::Library::load_with_flags(path, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)
37-
.map(From::from);
36+
let lib = unsafe {
37+
windows::Library::load_with_flags(path, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)
38+
.map(From::from)
39+
};
3840

3941
#[cfg(not(target_os = "windows"))]
40-
let lib = Library::new(path);
42+
let lib = unsafe { Library::new(path) };
4143

4244
if lib.is_ok() {
4345
return Ok(SymWrapper {

0 commit comments

Comments
 (0)