Add FFI definition for `PyModule_AddType`

This commit is contained in:
messense 2022-03-26 20:50:26 +08:00
parent 92c132569f
commit f3f0a612d8
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9
1 changed files with 6 additions and 1 deletions

View File

@ -77,7 +77,12 @@ extern "C" {
name: *const c_char,
value: *const c_char,
) -> c_int;
// skipped non-limited / 3.9 PyModule_AddType
#[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))]
#[cfg_attr(PyPy, link_name = "PyPyModule_AddType")]
pub fn PyModule_AddType(
module: *mut PyObject,
type_: *mut crate::object::PyTypeObject,
) -> c_int;
// skipped PyModule_AddIntMacro
// skipped PyModule_AddStringMacro
pub fn PyModule_SetDocString(arg1: *mut PyObject, arg2: *const c_char) -> c_int;