Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffi: more pypy fixes #2433

Merged
merged 1 commit into from
Jun 5, 2022
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix FFI definitions `PyDateTime_CAPI`. `PyDateTime_Date`, `PyASCIIObject`, `PyBaseExceptionObject`, `PyListObject`, and `PyTypeObject` on PyPy. [#2428](https://github.com/PyO3/pyo3/pull/2428)
- Fix FFI definition `_inittab` field `initfunc` typo'd as `initfun`. [#2431](https://github.com/PyO3/pyo3/pull/2431)
- Fix FFI definitions `_PyDateTime_BaseTime` and `_PyDateTime_BaseDateTime` incorrectly having `fold` member. [#2432](https://github.com/PyO3/pyo3/pull/2432)
- Fix FFI definitions `PyTypeObject`. `PyHeapTypeObject`, and `PyCFunctionObject` having incorrect members on PyPy 3.9. [#2428](https://github.com/PyO3/pyo3/pull/2428)

## [0.16.5] - 2022-05-15

Expand Down
13 changes: 7 additions & 6 deletions pyo3-ffi/src/cpython/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,15 @@ pub type printfunc =
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PyTypeObject {
#[cfg(PyPy)]
#[cfg(all(PyPy, not(Py_3_9)))]
pub ob_refcnt: Py_ssize_t,
#[cfg(PyPy)]
#[cfg(all(PyPy, not(Py_3_9)))]
pub ob_pypy_link: Py_ssize_t,
#[cfg(PyPy)]
#[cfg(all(PyPy, not(Py_3_9)))]
pub ob_type: *mut PyTypeObject,
#[cfg(PyPy)]
#[cfg(all(PyPy, not(Py_3_9)))]
pub ob_size: Py_ssize_t,
#[cfg(not(PyPy))]
#[cfg(not(all(PyPy, not(Py_3_9))))]
pub ob_base: object::PyVarObject,
pub tp_name: *const c_char,
pub tp_basicsize: Py_ssize_t,
Expand Down Expand Up @@ -276,7 +276,7 @@ pub struct PyTypeObject {
pub tp_finalize: Option<object::destructor>,
#[cfg(Py_3_8)]
pub tp_vectorcall: Option<super::vectorcallfunc>,
#[cfg(all(Py_3_8, not(Py_3_9)))]
#[cfg(any(all(PyPy, Py_3_8), all(not(PyPy), Py_3_8, not(Py_3_9))))]
pub tp_print: Option<printfunc>,
#[cfg(PyPy)]
pub tp_pypy_flags: std::os::raw::c_long,
Expand Down Expand Up @@ -304,6 +304,7 @@ pub struct PyHeapTypeObject {
pub ht_name: *mut object::PyObject,
pub ht_slots: *mut object::PyObject,
pub ht_qualname: *mut object::PyObject,
#[cfg(not(PyPy))]
pub ht_cached_keys: *mut c_void,
#[cfg(Py_3_9)]
pub ht_module: *mut object::PyObject,
Expand Down
6 changes: 6 additions & 0 deletions pyo3-ffi/src/cpython/pyerrors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,17 @@ pub struct PyOSErrorObject {
#[derive(Debug)]
pub struct PyStopIterationObject {
pub ob_base: PyObject,
#[cfg(not(PyPy))]
pub dict: *mut PyObject,
#[cfg(not(PyPy))]
pub args: *mut PyObject,
#[cfg(not(PyPy))]
pub traceback: *mut PyObject,
#[cfg(not(PyPy))]
pub context: *mut PyObject,
#[cfg(not(PyPy))]
pub cause: *mut PyObject,
#[cfg(not(PyPy))]
pub suppress_context: char,

pub value: *mut PyObject,
Expand Down
1 change: 0 additions & 1 deletion pyo3-ffi/src/methodobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub struct PyCFunctionObject {
pub m_ml: *mut PyMethodDef,
pub m_self: *mut PyObject,
pub m_module: *mut PyObject,
#[cfg(not(PyPy))]
pub m_weakreflist: *mut PyObject,
#[cfg(not(PyPy))]
pub vectorcall: Option<crate::vectorcallfunc>,
Expand Down