Skip to content

Commit

Permalink
link: Work around a rust miscompilation bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
emilio committed Nov 24, 2017
1 parent 30ce360 commit 2226f78
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ macro_rules! link {
#[cfg($cfg)]
pub fn $name(library: &mut super::SharedLibrary) {
let symbol = unsafe { library.library.get(stringify!($name).as_bytes()) }.ok();
library.functions.$name = symbol.map(|s| *s);
library.functions.$name = match symbol {
Some(s) => *s,
None => None,
};
}

#[cfg(not($cfg))]
Expand Down

0 comments on commit 2226f78

Please sign in to comment.