summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMatthias Klose <doko@ubuntu.com>2009-04-05 21:19:13 (GMT)
committerMatthias Klose <doko@ubuntu.com>2009-04-05 21:19:13 (GMT)
commit91a3b9e4f08a5e1325642c68543495c32fc853f9 (patch)
tree4a9213e6cad613529c58d77888e5fc6a123057d5 /Include
parenta5d58c831fa3b23960c9dfa78f7b9c62a31ce3e0 (diff)
downloadcpython-91a3b9e4f08a5e1325642c68543495c32fc853f9.zip
cpython-91a3b9e4f08a5e1325642c68543495c32fc853f9.tar.gz
cpython-91a3b9e4f08a5e1325642c68543495c32fc853f9.tar.bz2
Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add `do { ... } while (0)'
to avoid compiler warnings.
Diffstat (limited to 'Include')
-rw-r--r--Include/object.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/object.h b/Include/object.h
index 3d898f9..1bc13e7 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -801,8 +801,8 @@ PyAPI_FUNC(void) _Py_AddToAllObjects(PyObject *, int force);
} while (0)
/* Macros to use in case the object pointer may be NULL: */
-#define Py_XINCREF(op) if ((op) == NULL) ; else Py_INCREF(op)
-#define Py_XDECREF(op) if ((op) == NULL) ; else Py_DECREF(op)
+#define Py_XINCREF(op) do { if ((op) == NULL) ; else Py_INCREF(op); } while (0)
+#define Py_XDECREF(op) do { if ((op) == NULL) ; else Py_DECREF(op); } while (0)
/*
These are provided as conveniences to Python runtime embedders, so that