Add a typedef for Py_ssize_t, which is not available in python <2.5.
authorDave Borowitz <dborowitz@google.com>
Tue, 6 Apr 2010 23:29:49 +0000 (16:29 -0700)
committerDave Borowitz <dborowitz@google.com>
Fri, 30 Apr 2010 16:42:54 +0000 (09:42 -0700)
Based on a suggestion at:
http://mail.python.org/pipermail/python-dev/2006-March/062561.html

Change-Id: I170c17eab8eaf586da1db329c96c015edd59314b

dulwich/_objects.c

index d9699ec6cb4a72e52873929f679048e32d176819..986098bdb0b26d29193b7952b010e08048071135 100644 (file)
 #include <stdlib.h>
 #include <sys/stat.h>
 
+#if (PY_VERSION_HEX < 0x02050000)
+typedef int Py_ssize_t;
+#endif
+
 #define bytehex(x) (((x)<0xa)?('0'+(x)):('a'-0xa+(x)))
 
 static PyObject *sha_to_pyhex(const unsigned char *sha)