aboutsummaryrefslogtreecommitdiff
path: root/patches/libloading-0.7.diff
diff options
context:
space:
mode:
Diffstat (limited to 'patches/libloading-0.7.diff')
-rw-r--r--patches/libloading-0.7.diff47
1 files changed, 47 insertions, 0 deletions
diff --git a/patches/libloading-0.7.diff b/patches/libloading-0.7.diff
new file mode 100644
index 0000000..49fdc4c
--- /dev/null
+++ b/patches/libloading-0.7.diff
@@ -0,0 +1,47 @@
+diff --git a/Cargo.toml b/Cargo.toml
+index 1da2ac4..4af7f4d 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -31,7 +31,7 @@ version = "0.2.39"
+ default-features = false
+
+ [dependencies.libloading]
+-version = "0.6"
++version = "0.7"
+ optional = true
+ [build-dependencies.glob]
+ version = "0.3"
+diff --git a/src/link.rs b/src/link.rs
+index 3230e4a..64a3528 100644
+--- a/src/link.rs
++++ b/src/link.rs
+@@ -195,17 +195,19 @@ macro_rules! link {
+ let (directory, filename) = build::dynamic::find(true)?;
+ let path = directory.join(filename);
+
+- let library = libloading::Library::new(&path).map_err(|e| {
+- format!(
+- "the `libclang` shared library at {} could not be opened: {}",
+- path.display(),
+- e,
+- )
+- });
++ unsafe {
++ let library = libloading::Library::new(&path).map_err(|e| {
++ format!(
++ "the `libclang` shared library at {} could not be opened: {}",
++ path.display(),
++ e,
++ )
++ });
+
+- let mut library = SharedLibrary::new(library?, path);
+- $(load::$name(&mut library);)+
+- Ok(library)
++ let mut library = SharedLibrary::new(library?, path);
++ $(load::$name(&mut library);)+
++ Ok(library)
++ }
+ }
+
+ /// Loads a `libclang` shared library for use in the current thread.