Define _PyDict_Contains_KnownHash() FFI for CPython 3.10 or later

This commit is contained in:
ijl 2023-04-09 14:36:42 +00:00
parent 77fc6e6734
commit 6ee2174fec
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1 @@
Define `_PyDict_Contains_KnownHash()` FFI for CPython 3.10 or later.

View File

@ -42,7 +42,6 @@ extern "C" {
hash: *mut crate::Py_hash_t, hash: *mut crate::Py_hash_t,
) -> c_int; ) -> c_int;
// skipped PyDict_GET_SIZE // skipped PyDict_GET_SIZE
// skipped _PyDict_Contains_KnownHash
// skipped _PyDict_ContainsId // skipped _PyDict_ContainsId
pub fn _PyDict_NewPresized(minused: Py_ssize_t) -> *mut PyObject; pub fn _PyDict_NewPresized(minused: Py_ssize_t) -> *mut PyObject;
// skipped _PyDict_MaybeUntrack // skipped _PyDict_MaybeUntrack
@ -63,6 +62,14 @@ extern "C" {
// skipped _PyDictViewObject // skipped _PyDictViewObject
// skipped _PyDictView_New // skipped _PyDictView_New
// skipped _PyDictView_Intersect // skipped _PyDictView_Intersect
#[cfg(Py_3_10)]
pub fn _PyDict_Contains_KnownHash(
op: *mut PyObject,
key: *mut PyObject,
hash: crate::Py_hash_t,
) -> c_int;
#[cfg(not(Py_3_10))] #[cfg(not(Py_3_10))]
pub fn _PyDict_Contains(mp: *mut PyObject, key: *mut PyObject, hash: Py_ssize_t) -> c_int; pub fn _PyDict_Contains(mp: *mut PyObject, key: *mut PyObject, hash: Py_ssize_t) -> c_int;
} }