summaryrefslogtreecommitdiff
path: root/contrib/py-bindings/gfmodule.c
diff options
context:
space:
mode:
authorjordi.saludes <jordi.saludes@upc.edu>2010-06-13 17:07:49 +0000
committerjordi.saludes <jordi.saludes@upc.edu>2010-06-13 17:07:49 +0000
commitd8c65b97329baee16351cd2043e3f07d26fe723b (patch)
tree432c51d2a3d2c40ff555750b1a5ee5bfae67c5b9 /contrib/py-bindings/gfmodule.c
parentccbbd4e848ce711c967ca8e98e211c49f5d022fa (diff)
DEBUG mode added.
Diffstat (limited to 'contrib/py-bindings/gfmodule.c')
-rw-r--r--contrib/py-bindings/gfmodule.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/contrib/py-bindings/gfmodule.c b/contrib/py-bindings/gfmodule.c
index e70db604d..5ed4f1851 100644
--- a/contrib/py-bindings/gfmodule.c
+++ b/contrib/py-bindings/gfmodule.c
@@ -32,15 +32,28 @@
#define NEWGF(OBJ,GFTYPE,TYPE,NAME,DOC) NEWOBJECT(OBJ,GFTYPE) \
NEWTYPE(TYPE,NAME,OBJ,DOC)
+#ifdef DEBUG
#define DEALLOCFN(delname,t,cb,cbname) static void \
delname(t *self){ cb(self->obj);\
printf("gf_%s has been called for stable pointer 0x%x\n", cbname, self->obj);\
self->ob_type->tp_free((PyObject*)self); }
+#else
+#define DEALLOCFN(delname,t,cb,cbname) static void \
+delname(t *self){ cb(self->obj);\
+ self->ob_type->tp_free((PyObject*)self); }
+#endif
+#ifdef DEBUG
#define REPRCB(cbid,t,gfcb) static PyObject* \
cbid(t *self) { \
const char *str = gfcb(self->obj); \
return PyString_FromFormat("0x%x: %s", self->obj, str); }
+#else
+#define REPRCB(cbid,t,gfcb) static PyObject* \
+cbid(t *self) { \
+ const char *str = gfcb(self->obj); \
+ return PyString_FromString(str); }
+#endif
/* utilities */