Skip to content

Commit

Permalink
Add FFI definition for PyModule_AddType
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Mar 26, 2022
1 parent c3cabed commit 6385385
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyo3-ffi/src/modsupport.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::methodobject::PyMethodDef;
use crate::moduleobject::PyModuleDef;
use crate::object::PyObject;
use crate::object::{PyObject, PyTypeObject};
use crate::pyport::Py_ssize_t;
use std::os::raw::{c_char, c_int, c_long};

Expand Down Expand Up @@ -77,7 +77,9 @@ 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 PyTypeObject) -> c_int;
// skipped PyModule_AddIntMacro
// skipped PyModule_AddStringMacro
pub fn PyModule_SetDocString(arg1: *mut PyObject, arg2: *const c_char) -> c_int;
Expand Down

0 comments on commit 6385385

Please sign in to comment.