diff options
author | Jeff Vander Stoep <jeffv@google.com> | 2021-02-19 19:59:49 +0100 |
---|---|---|
committer | Jeff Vander Stoep <jeffv@google.com> | 2021-02-19 20:26:15 +0100 |
commit | 582dabe84f21fbf55be0e2abd4ccf2f0bcd6e612 (patch) | |
tree | 68313dec40dcd5e31376b569b6fc43c9c06a667c /patches/libloading-0.7.diff | |
parent | 7b49646c5daa773237f4492599406b6a7ac27dde (diff) | |
download | clang-sys-582dabe84f21fbf55be0e2abd4ccf2f0bcd6e612.tar.gz |
Update libloading dep to 0.7
Cherry-pick of https://github.com/KyleMayes/clang-sys/pull/123
Test: atest
Change-Id: I66610794a04947d412836dca3bd5d1f99769276e
Diffstat (limited to 'patches/libloading-0.7.diff')
-rw-r--r-- | patches/libloading-0.7.diff | 47 |
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. |