Build workaround for Python 2.4.x in RHEL 5.
authorRichard W.M. Jones <rjones@redhat.com>
Fri, 21 May 2010 17:20:28 +0000 (18:20 +0100)
committerRichard Jones <rjones@redhat.com>
Fri, 21 May 2010 17:21:40 +0000 (18:21 +0100)
See:
http://www.python.org/dev/peps/pep-0353/#conversion-guidelines

src/generator.ml

index d2da8ec..1212a5a 100755 (executable)
@@ -9113,6 +9113,12 @@ and generate_python_c () =
 #define PY_SSIZE_T_CLEAN 1
 #include <Python.h>
 
 #define PY_SSIZE_T_CLEAN 1
 #include <Python.h>
 
+#if PY_VERSION_HEX < 0x02050000
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>