From: Thomas Wouters Date: Sat, 15 Apr 2006 17:33:14 +0000 (+0000) Subject: Re-instate backward compatibility by defining Py_CLEAR if it isn't X-Git-Tag: v2.5a2~210 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2742c5ed633776acb0cef21801acad9214b87094;p=thirdparty%2FPython%2Fcpython.git Re-instate backward compatibility by defining Py_CLEAR if it isn't available. --- diff --git a/Modules/_csv.c b/Modules/_csv.c index 88c72481d890..9ce53bdade75 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -37,6 +37,20 @@ module instead. # define PyMODINIT_FUNC void # endif /* __cplusplus */ #endif + +#ifndef Py_CLEAR +#define Py_CLEAR(op) \ + do { \ + if (op) { \ + PyObject *tmp = (PyObject *)(op); \ + (op) = NULL; \ + Py_DECREF(tmp); \ + } \ + } while (0) +#endif +#ifndef Py_VISIT + + /* end 2.2 compatibility macros */ #define IS_BASESTRING(o) \