summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-10-19 10:58:46 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-10-19 10:58:46 (GMT)
commitaac1316222c7e4a073af1634f2eef0a872a3dafb (patch)
treef200e0b491ba8b0bccc490a116b48763633e0c48 /Include
parentb03c35bac3a17aad776a1ef8e81706cf56412143 (diff)
downloadcpython-aac1316222c7e4a073af1634f2eef0a872a3dafb.zip
cpython-aac1316222c7e4a073af1634f2eef0a872a3dafb.tar.gz
cpython-aac1316222c7e4a073af1634f2eef0a872a3dafb.tar.bz2
Add check for the PyArg_ParseTuple format, and declare
it if it is supported.
Diffstat (limited to 'Include')
-rw-r--r--Include/modsupport.h2
-rw-r--r--Include/pyport.h9
2 files changed, 10 insertions, 1 deletions
diff --git a/Include/modsupport.h b/Include/modsupport.h
index 23d5d3a..761d960 100644
--- a/Include/modsupport.h
+++ b/Include/modsupport.h
@@ -24,7 +24,7 @@ PyAPI_FUNC(PyObject *) _Py_VaBuildValue_SizeT(const char *, va_list);
#endif
PyAPI_FUNC(int) PyArg_Parse(PyObject *, const char *, ...);
-PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...);
+PyAPI_FUNC(int) PyArg_ParseTuple(PyObject *, const char *, ...) Py_FORMAT_PARSETUPLE(PyArg_ParseTuple, 2, 3);
PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
const char *, char **, ...);
PyAPI_FUNC(int) PyArg_UnpackTuple(PyObject *, const char *, Py_ssize_t, Py_ssize_t, ...);
diff --git a/Include/pyport.h b/Include/pyport.h
index 6fe3f0b..36d517c 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -749,6 +749,15 @@ typedef struct fd_set {
#define Py_GCC_ATTRIBUTE(x) __attribute__(x)
#endif
+/*
+ * Add PyArg_ParseTuple format where available.
+ */
+#ifdef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
+#define Py_FORMAT_PARSETUPLE(func,p1,p2) __attribute__((format(func,p1,p2)))
+#else
+#define Py_FORMAT_PARSETUPLE(func,p1,p2)
+#endif
+
/* Eliminate end-of-loop code not reached warnings from SunPro C
* when using do{...}while(0) macros
*/