summaryrefslogtreecommitdiffstats
path: root/Include/modsupport.h
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-06-02 23:06:47 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-06-02 23:06:47 (GMT)
commitca829102213c466ffecb1e464be5c8cb3967d961 (patch)
tree98993ee236ae34d2882fbae2c8d66cea899b12f3 /Include/modsupport.h
parent72ea27c89ba48b914e80743ee3391ed0fdda82be (diff)
downloadcpython-ca829102213c466ffecb1e464be5c8cb3967d961.zip
cpython-ca829102213c466ffecb1e464be5c8cb3967d961.tar.gz
cpython-ca829102213c466ffecb1e464be5c8cb3967d961.tar.bz2
Issue 24365: Conditionalize PEP 489 additions to the stable ABI
Patch by Petr Viktorin.
Diffstat (limited to 'Include/modsupport.h')
-rw-r--r--Include/modsupport.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/Include/modsupport.h b/Include/modsupport.h
index 21bffb5..829aaf8 100644
--- a/Include/modsupport.h
+++ b/Include/modsupport.h
@@ -49,9 +49,13 @@ PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long);
PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *);
#define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c)
#define PyModule_AddStringMacro(m, c) PyModule_AddStringConstant(m, #c, c)
+
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
+/* New in 3.5 */
PyAPI_FUNC(int) PyModule_SetDocString(PyObject *, const char *);
PyAPI_FUNC(int) PyModule_AddFunctions(PyObject *, PyMethodDef *);
PyAPI_FUNC(int) PyModule_ExecDef(PyObject *module, PyModuleDef *def);
+#endif
#define Py_CLEANUP_SUPPORTED 0x20000
@@ -126,6 +130,8 @@ PyAPI_FUNC(PyObject *) PyModule_Create2(struct PyModuleDef*,
PyModule_Create2(module, PYTHON_API_VERSION)
#endif
+#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
+/* New in 3.5 */
PyAPI_FUNC(PyObject *) PyModule_FromDefAndSpec2(PyModuleDef *def,
PyObject *spec,
int module_api_version);
@@ -136,7 +142,8 @@ PyAPI_FUNC(PyObject *) PyModule_FromDefAndSpec2(PyModuleDef *def,
#else
#define PyModule_FromDefAndSpec(module, spec) \
PyModule_FromDefAndSpec2(module, spec, PYTHON_API_VERSION)
-#endif
+#endif /* Py_LIMITED_API */
+#endif /* New in 3.5 */
#ifndef Py_LIMITED_API
PyAPI_DATA(char *) _Py_PackageContext;