Browse Source

Add a typedef for Py_ssize_t, which is not available in python <2.5.

Based on a suggestion at:
http://mail.python.org/pipermail/python-dev/2006-March/062561.html

Change-Id: I170c17eab8eaf586da1db329c96c015edd59314b
Dave Borowitz 15 years ago
parent
commit
f116295de4
1 changed files with 4 additions and 0 deletions
  1. 4 0
      dulwich/_objects.c

+ 4 - 0
dulwich/_objects.c

@@ -21,6 +21,10 @@
 #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)