Skip to content

Commit 01fb2fb

Browse files
committed
fix defines for ParseStack and ParseTupleAndKeywords
1 parent e782668 commit 01fb2fb

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

graalpython/com.oracle.graal.python.cext/include/Python.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@
153153
#undef Py_RETURN_NONE
154154
#define Py_RETURN_NONE return Py_None;
155155

156+
extern int _PyArg_ParseTupleAndKeywords_SizeT(PyObject *argv, PyObject *kwds, const char *format, char** kwdnames, ...);
157+
156158
// we use defines for these so we don't need to call with va_list
157159
#define _PyArg_Parse_SizeT(ARGV, FORMAT, ...) PyArg_ParseTupleAndKeywords(ARGV, PyDict_New(), FORMAT, NULL, __VA_ARGS__)
158160
#define _PyArg_ParseTuple_SizeT(ARGV, FORMAT, ...) PyArg_ParseTupleAndKeywords(ARGV, PyDict_New(), FORMAT, NULL, __VA_ARGS__)
@@ -167,6 +169,14 @@
167169
#define PyArg_ParseTuple _PyArg_ParseTuple_SizeT
168170
#endif
169171

172+
#ifndef PyArg_ParseTupleAndKeywords
173+
#define PyArg_ParseTupleAndKeywords _PyArg_ParseTupleAndKeywords_SizeT
174+
#endif
175+
176+
#ifndef _PyArg_ParseStack
177+
#define _PyArg_ParseStack _PyArg_ParseStack_SizeT
178+
#endif
179+
170180
extern PyObject * PyTruffle_Unicode_FromFormat(const char *fmt, int s, void* v0, void* v1, void* v2, void* v3, void* v4, void* v5, void* v6, void* v7, void* v8, void* v9, void* v10, void* v11, void* v12, void* v13, void* v14, void* v15, void* v16, void* v17, void* v18, void* v19);
171181
#define PyTruffle_Unicode_FromFormat_0(F1) PyTruffle_Unicode_FromFormat(F1, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
172182
#define PyTruffle_Unicode_FromFormat_1(F1, V1) PyTruffle_Unicode_FromFormat(F1, 1, (void*)(V1), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)

graalpython/com.oracle.graal.python.cext/src/modsupport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ PyObject* PyTruffle_GetArg(positional_argstack* p, PyObject* kwds, char** kwdnam
8686

8787
/* argparse */
8888
UPCALL_ID(__bool__);
89-
int PyArg_ParseTupleAndKeywords(PyObject *argv, PyObject *kwds, const char *format, char** kwdnames, ...) {
89+
int _PyArg_ParseTupleAndKeywords_SizeT(PyObject *argv, PyObject *kwds, const char *format, char** kwdnames, ...) {
9090
PyObject* arg;
9191
int format_idx = 0;
9292
int output_idx = 4;

0 commit comments

Comments
 (0)