bpo-45459: C API uses type names rather than structure names (GH-31528)

Thanks to the new pytypedefs.h, it becomes to use type names like
PyObject rather like structure names like "struct _object".
This commit is contained in:
Victor Stinner 2022-02-24 17:51:59 +01:00 committed by GitHub
parent ec091bd47e
commit 042f31da55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 69 additions and 75 deletions

View file

@ -32,12 +32,12 @@ PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
PyAPI_FUNC(void) _PyModule_ClearDict(PyObject *);
PyAPI_FUNC(int) _PyModuleSpec_IsInitializing(PyObject *);
#endif
PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*);
PyAPI_FUNC(PyModuleDef*) PyModule_GetDef(PyObject*);
PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
/* New in 3.5 */
PyAPI_FUNC(PyObject *) PyModuleDef_Init(struct PyModuleDef*);
PyAPI_FUNC(PyObject *) PyModuleDef_Init(PyModuleDef*);
PyAPI_DATA(PyTypeObject) PyModuleDef_Type;
#endif
@ -56,6 +56,7 @@ typedef struct PyModuleDef_Base {
}
struct PyModuleDef_Slot;
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
/* New in 3.5 */
typedef struct PyModuleDef_Slot{
@ -78,7 +79,7 @@ struct PyModuleDef {
const char* m_doc;
Py_ssize_t m_size;
PyMethodDef *m_methods;
struct PyModuleDef_Slot* m_slots;
PyModuleDef_Slot *m_slots;
traverseproc m_traverse;
inquiry m_clear;
freefunc m_free;