Skip to content

Commit

Permalink
fix warning on nightly rust about extern usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum committed Feb 12, 2025
1 parent 2b9ccf2 commit ee9066c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/npyffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ macro_rules! impl_api {
[$offset: expr; $fname: ident ($($arg: ident: $t: ty),* $(,)?) $(-> $ret: ty)?] => {
#[allow(non_snake_case)]
pub unsafe fn $fname<'py>(&self, py: Python<'py>, $($arg : $t), *) $(-> $ret)* {
let fptr = self.get(py, $offset) as *const extern fn ($($arg : $t), *) $(-> $ret)*;
let fptr = self.get(py, $offset) as *const extern "C" fn ($($arg : $t), *) $(-> $ret)*;
(*fptr)($($arg), *)
}
};
Expand All @@ -69,7 +69,7 @@ macro_rules! impl_api {
API_VERSION_2_0,
*API_VERSION.get(py).expect("API_VERSION is initialized"),
);
let fptr = self.get(py, $offset) as *const extern fn ($($arg: $t), *) $(-> $ret)*;
let fptr = self.get(py, $offset) as *const extern "C" fn ($($arg: $t), *) $(-> $ret)*;
(*fptr)($($arg), *)
}

Expand All @@ -84,7 +84,7 @@ macro_rules! impl_api {
API_VERSION_2_0,
*API_VERSION.get(py).expect("API_VERSION is initialized"),
);
let fptr = self.get(py, $offset) as *const extern fn ($($arg: $t), *) $(-> $ret)*;
let fptr = self.get(py, $offset) as *const extern "C" fn ($($arg: $t), *) $(-> $ret)*;
(*fptr)($($arg), *)
}

Expand Down

0 comments on commit ee9066c

Please sign in to comment.