mirror of
https://github.com/python/cpython
synced 2026-09-29 11:35:29 +03:00
Issue 24365: Conditionalize PEP 489 additions to the stable ABI
Patch by Petr Viktorin.
This commit is contained in:
parent
72ea27c89b
commit
ca82910221
3 changed files with 31 additions and 13 deletions
|
|
@ -30,8 +30,11 @@ PyAPI_FUNC(void) _PyModule_ClearDict(PyObject *);
|
|||
PyAPI_FUNC(struct 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_DATA(PyTypeObject) PyModuleDef_Type;
|
||||
#endif
|
||||
|
||||
typedef struct PyModuleDef_Base {
|
||||
PyObject_HEAD
|
||||
|
|
@ -47,23 +50,14 @@ typedef struct PyModuleDef_Base {
|
|||
NULL, /* m_copy */ \
|
||||
}
|
||||
|
||||
struct PyModuleDef_Slot;
|
||||
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
|
||||
/* New in 3.5 */
|
||||
typedef struct PyModuleDef_Slot{
|
||||
int slot;
|
||||
void *value;
|
||||
} PyModuleDef_Slot;
|
||||
|
||||
typedef struct PyModuleDef{
|
||||
PyModuleDef_Base m_base;
|
||||
const char* m_name;
|
||||
const char* m_doc;
|
||||
Py_ssize_t m_size;
|
||||
PyMethodDef *m_methods;
|
||||
PyModuleDef_Slot* m_slots;
|
||||
traverseproc m_traverse;
|
||||
inquiry m_clear;
|
||||
freefunc m_free;
|
||||
}PyModuleDef;
|
||||
|
||||
#define Py_mod_create 1
|
||||
#define Py_mod_exec 2
|
||||
|
||||
|
|
@ -71,6 +65,20 @@ typedef struct PyModuleDef{
|
|||
#define _Py_mod_LAST_SLOT 2
|
||||
#endif
|
||||
|
||||
#endif /* New in 3.5 */
|
||||
|
||||
typedef struct PyModuleDef{
|
||||
PyModuleDef_Base m_base;
|
||||
const char* m_name;
|
||||
const char* m_doc;
|
||||
Py_ssize_t m_size;
|
||||
PyMethodDef *m_methods;
|
||||
struct PyModuleDef_Slot* m_slots;
|
||||
traverseproc m_traverse;
|
||||
inquiry m_clear;
|
||||
freefunc m_free;
|
||||
}PyModuleDef;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue