ffi: more pypy fixes

This commit is contained in:
David Hewitt 2022-06-05 09:18:42 +01:00
parent 5b82090005
commit 6f4e84f25f
4 changed files with 14 additions and 7 deletions

View File

@ -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

View File

@ -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,
@ -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,
@ -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,

View File

@ -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,

View File

@ -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>,