| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 72ea27c commit ca82910
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,9 +49,13 @@ PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long); | |||
| 49 | 49 | PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *); | |
| 50 | 50 | #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c) | |
| 51 | 51 | #define PyModule_AddStringMacro(m, c) PyModule_AddStringConstant(m, #c, c) | |
| 52 | + | ||
| 53 | + #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 | ||
| 54 | + /* New in 3.5 */ | ||
| 52 | 55 | PyAPI_FUNC(int) PyModule_SetDocString(PyObject *, const char *); | |
| 53 | 56 | PyAPI_FUNC(int) PyModule_AddFunctions(PyObject *, PyMethodDef *); | |
| 54 | 57 | PyAPI_FUNC(int) PyModule_ExecDef(PyObject *module, PyModuleDef *def); | |
| 58 | + #endif | ||
| 55 | 59 | ||
| 56 | 60 | #define Py_CLEANUP_SUPPORTED 0x20000 | |
| 57 | 61 | ||
@@ -126,6 +130,8 @@ PyAPI_FUNC(PyObject *) PyModule_Create2(struct PyModuleDef*, | |||
| 126 | 130 | PyModule_Create2(module, PYTHON_API_VERSION) | |
| 127 | 131 | #endif | |
| 128 | 132 | ||
| 133 | + #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 | ||
| 134 | + /* New in 3.5 */ | ||
| 129 | 135 | PyAPI_FUNC(PyObject *) PyModule_FromDefAndSpec2(PyModuleDef *def, | |
| 130 | 136 | PyObject *spec, | |
| 131 | 137 | int module_api_version); | |
@@ -136,7 +142,8 @@ PyAPI_FUNC(PyObject *) PyModule_FromDefAndSpec2(PyModuleDef *def, | |||
| 136 | 142 | #else | |
| 137 | 143 | #define PyModule_FromDefAndSpec(module, spec) \ | |
| 138 | 144 | PyModule_FromDefAndSpec2(module, spec, PYTHON_API_VERSION) | |
| 139 | - #endif | ||
| 145 | + #endif /* Py_LIMITED_API */ | ||
| 146 | + #endif /* New in 3.5 */ | ||
| 140 | 147 | ||
| 141 | 148 | #ifndef Py_LIMITED_API | |
| 142 | 149 | PyAPI_DATA(char *) _Py_PackageContext; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,8 +30,11 @@ PyAPI_FUNC(void) _PyModule_ClearDict(PyObject *); | |||
| 30 | 30 | PyAPI_FUNC(struct PyModuleDef*) PyModule_GetDef(PyObject*); | |
| 31 | 31 | PyAPI_FUNC(void*) PyModule_GetState(PyObject*); | |
| 32 | 32 | ||
| 33 | + #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 | ||
| 34 | + /* New in 3.5 */ | ||
| 33 | 35 | PyAPI_FUNC(PyObject *) PyModuleDef_Init(struct PyModuleDef*); | |
| 34 | 36 | PyAPI_DATA(PyTypeObject) PyModuleDef_Type; | |
| 37 | + #endif | ||
| 35 | 38 | ||
| 36 | 39 | typedef struct PyModuleDef_Base { | |
| 37 | 40 | PyObject_HEAD | |
@@ -47,30 +50,35 @@ typedef struct PyModuleDef_Base { | |||
| 47 | 50 | NULL, /* m_copy */ \ | |
| 48 | 51 | } | |
| 49 | 52 | ||
| 53 | + struct PyModuleDef_Slot; | ||
| 54 | + #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 | ||
| 55 | + /* New in 3.5 */ | ||
| 50 | 56 | typedef struct PyModuleDef_Slot{ | |
| 51 | 57 | int slot; | |
| 52 | 58 | void *value; | |
| 53 | 59 | } PyModuleDef_Slot; | |
| 54 | 60 | ||
| 61 | + #define Py_mod_create 1 | ||
| 62 | + #define Py_mod_exec 2 | ||
| 63 | + | ||
| 64 | + #ifndef Py_LIMITED_API | ||
| 65 | + #define _Py_mod_LAST_SLOT 2 | ||
| 66 | + #endif | ||
| 67 | + | ||
| 68 | + #endif /* New in 3.5 */ | ||
| 69 | + | ||
| 55 | 70 | typedef struct PyModuleDef{ | |
| 56 | 71 | PyModuleDef_Base m_base; | |
| 57 | 72 | const char* m_name; | |
| 58 | 73 | const char* m_doc; | |
| 59 | 74 | Py_ssize_t m_size; | |
| 60 | 75 | PyMethodDef *m_methods; | |
| 61 | - PyModuleDef_Slot* m_slots; | ||
| 76 | + struct PyModuleDef_Slot* m_slots; | ||
| 62 | 77 | traverseproc m_traverse; | |
| 63 | 78 | inquiry m_clear; | |
| 64 | 79 | freefunc m_free; | |
| 65 | 80 | }PyModuleDef; | |
| 66 | 81 | ||
| 67 | - #define Py_mod_create 1 | ||
| 68 | - #define Py_mod_exec 2 | ||
| 69 | - | ||
| 70 | - #ifndef Py_LIMITED_API | ||
| 71 | - #define _Py_mod_LAST_SLOT 2 | ||
| 72 | - #endif | ||
| 73 | - | ||
| 74 | 82 | #ifdef __cplusplus | |
| 75 | 83 | } | |
| 76 | 84 | #endif | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,4 +79,7 @@ | |||
| 79 | 79 | #define Py_am_await 77 | |
| 80 | 80 | #define Py_am_aiter 78 | |
| 81 | 81 | #define Py_am_anext 79 | |
| 82 | + #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000 | ||
| 83 | + /* New in 3.5 */ | ||
| 82 | 84 | #define Py_tp_finalize 80 | |
| 85 | + #endif | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments