summaryrefslogtreecommitdiff
path: root/python/generic.h
diff options
context:
space:
mode:
authorMichael Vogt <egon@bottom>2007-05-02 18:43:13 +0200
committerMichael Vogt <egon@bottom>2007-05-02 18:43:13 +0200
commit500e805d3fa7faee957e67410f525435224f1e21 (patch)
treefad6c63e9aa28d7df2effe7d378923e05cf2db10 /python/generic.h
parenta231ca12f5fbb6adb55142973eb4d7a284763ace (diff)
parentcccfb88edd8dd82348ff89f96a0b26ac815b483c (diff)
downloadpython-apt-500e805d3fa7faee957e67410f525435224f1e21.tar.gz
* merged from python-apt--mvo
Diffstat (limited to 'python/generic.h')
-rw-r--r--python/generic.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/generic.h b/python/generic.h
index a808e28d..a1b662bb 100644
--- a/python/generic.h
+++ b/python/generic.h
@@ -31,6 +31,10 @@
#include <string>
#include <new>
+#if PYTHON_API_VERSION < 1013
+typedef int Py_ssize_t;
+#endif
+
template <class T> struct CppPyObject : public PyObject
{
// We are only using CppPyObject and friends as dumb structs only, ie the
@@ -109,7 +113,7 @@ template <class T>
void CppDealloc(PyObject *Obj)
{
GetCpp<T>(Obj).~T();
- PyMem_DEL(Obj);
+ PyObject_DEL(Obj);
}
template <class T>
@@ -119,7 +123,7 @@ void CppOwnedDealloc(PyObject *iObj)
Obj->Object.~T();
if (Obj->Owner != 0)
Py_DECREF(Obj->Owner);
- PyMem_DEL(Obj);
+ PyObject_DEL(Obj);
}
inline PyObject *CppPyString(std::string Str)