From: Victor Stinner Date: Mon, 13 Jun 2022 14:24:19 +0000 (+0200) Subject: Remove ANY_VARARGS() macro from the C API (#93764) X-Git-Tag: v3.12.0a1~1286 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65ac273280fa909f42dd78f3da634e6669e2b63d;p=thirdparty%2FPython%2Fcpython.git Remove ANY_VARARGS() macro from the C API (#93764) The macro was exposed by mistake. --- diff --git a/Include/cpython/modsupport.h b/Include/cpython/modsupport.h index 769eb52bf6e3..74ef999b7aeb 100644 --- a/Include/cpython/modsupport.h +++ b/Include/cpython/modsupport.h @@ -34,11 +34,13 @@ PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args); #define _PyArg_NoPositional(funcname, args) \ ((args) == NULL || _PyArg_NoPositional((funcname), (args))) +#define _Py_ANY_VARARGS(n) (n == PY_SSIZE_T_MAX) + PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *); PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t); #define _PyArg_CheckPositional(funcname, nargs, min, max) \ - ((!ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \ + ((!_Py_ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \ || _PyArg_CheckPositional((funcname), (nargs), (min), (max))) PyAPI_FUNC(PyObject **) _Py_VaBuildStack( diff --git a/Include/modsupport.h b/Include/modsupport.h index 0e96a5c98884..c42a3f17a2bf 100644 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -37,8 +37,6 @@ PyAPI_FUNC(PyObject *) Py_BuildValue(const char *, ...); PyAPI_FUNC(PyObject *) _Py_BuildValue_SizeT(const char *, ...); -#define ANY_VARARGS(n) (n == PY_SSIZE_T_MAX) - PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list); // Add an attribute with name 'name' and value 'obj' to the module 'mod.