Skip to content

Commit

Permalink
Fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda authored and timothee-haudebourg committed Oct 5, 2023
1 parent 0d5fa59 commit cbc6c23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2299,7 +2299,10 @@ macro_rules! api {
$(
let name = stringify!($name).as_bytes();
let symbol = lib.get::<unsafe extern "system" fn($($atype ),*) -> $rtype>(name)?;
#[cfg(unix)]
let ptr = (&symbol.into_raw().into_raw()) as *const *mut _ as *const unsafe extern "system" fn($($atype ),*) -> $rtype;
#[cfg(windows)]
let ptr = (&symbol.into_raw().into_raw()) as *const _ as *const unsafe extern "system" fn($($atype ),*) -> $rtype;
assert!(!ptr.is_null());
raw.$name = std::mem::MaybeUninit::new(*ptr);
)*
Expand Down

0 comments on commit cbc6c23

Please sign in to comment.