Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/6013.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use `std::ffi` C type aliases instead of `std::os::raw` aliases internally.
2 changes: 1 addition & 1 deletion pyo3-ffi/src/cpython/lock.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[cfg(Py_3_14)]
use std::os::raw::c_int;
use std::ffi::c_int;
use std::sync::atomic::AtomicU8;

#[repr(transparent)]
Expand Down
2 changes: 1 addition & 1 deletion pyo3-macros-backend/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ fn module_initialization(
pub static _PYO3_DEF: #pyo3_path::impl_::pymodule::ModuleDef = {
use #pyo3_path::impl_::pymodule as impl_;

unsafe extern "C" fn __pyo3_module_exec(module: *mut #pyo3_path::ffi::PyObject) -> ::std::os::raw::c_int {
unsafe extern "C" fn __pyo3_module_exec(module: *mut #pyo3_path::ffi::PyObject) -> ::std::ffi::c_int {
#pyo3_path::impl_::trampoline::module_exec(module, #module_exec)
}

Expand Down
2 changes: 1 addition & 1 deletion src/impl_/callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub trait PyCallbackOutput: Copy + py_callback_output::Sealed {

/// Seals `PyCallbackOutput` so that types outside PyO3 cannot implement it.
mod py_callback_output {
use std::os::raw::c_int;
use std::ffi::c_int;

use pyo3_ffi::Py_ssize_t;

Expand Down
2 changes: 1 addition & 1 deletion src/impl_/pyclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use crate::{
};
use std::{
ffi::CStr,
ffi::{c_int, c_void},
marker::PhantomData,
os::raw::{c_int, c_void},
ptr::{self, NonNull},
sync::Mutex,
thread,
Expand Down
4 changes: 2 additions & 2 deletions src/impl_/pymodule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
use std::{
cell::UnsafeCell,
ffi::CStr,
ffi::{c_int, c_void},
marker::PhantomData,
os::raw::{c_int, c_void},
};

#[cfg(all(
Expand Down Expand Up @@ -418,7 +418,7 @@ impl PyAddToModule for ModuleDef {

#[cfg(test)]
mod tests {
use std::{borrow::Cow, ffi::CStr, os::raw::c_int};
use std::{borrow::Cow, ffi::c_int, ffi::CStr};

use crate::{
ffi,
Expand Down
2 changes: 1 addition & 1 deletion src/impl_/trampoline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use std::{
any::Any,
os::raw::c_int,
ffi::c_int,
panic::{self, UnwindSafe},
};

Expand Down
2 changes: 1 addition & 1 deletion src/pyclass.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! `PyClass` and related traits.
use crate::{ffi, impl_::pyclass::PyClassImpl, PyTypeInfo};
use std::{cmp::Ordering, os::raw::c_int};
use std::{cmp::Ordering, ffi::c_int};

mod create_type_object;
mod gc;
Expand Down
2 changes: 1 addition & 1 deletion src/pyclass/create_type_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use crate::{
};
use std::{
collections::HashMap,
ffi::{c_char, c_int, c_ulong, c_void},
ffi::{CStr, CString},
os::raw::{c_char, c_int, c_ulong, c_void},
ptr::{self, NonNull},
};

Expand Down
2 changes: 1 addition & 1 deletion src/pyclass/gc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{
ffi::{c_int, c_void},
marker::PhantomData,
num::NonZero,
os::raw::{c_int, c_void},
};

use crate::{ffi, Py};
Expand Down
2 changes: 1 addition & 1 deletion tests/test_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use pyo3::{buffer::PyBuffer, exceptions::PyBufferError, ffi, prelude::*};
use std::{
os::raw::{c_int, c_void},
ffi::{c_int, c_void},
ptr,
};

Expand Down
Loading