]> granicus.if.org Git - python/commitdiff
Re-instate backward compatibility by defining Py_CLEAR if it isn't
authorThomas Wouters <thomas@python.org>
Sat, 15 Apr 2006 17:33:14 +0000 (17:33 +0000)
committerThomas Wouters <thomas@python.org>
Sat, 15 Apr 2006 17:33:14 +0000 (17:33 +0000)
available.

Modules/_csv.c

index 88c72481d8901af566b0ad7bf79d9cb8123a8b90..9ce53bdade75c941da1c56ae133c799e0381f6a2 100644 (file)
@@ -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) \