waliwali / ibm-db

Automatically exported from code.google.com/p/ibm-db
0 stars 0 forks source link

Does not compile for Python 2.4. #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Py_ssize_t type isn't defined in Python 2.4 headers and int is used
instead. The following trivial patch helps (although it is not perfect -
PY_MAJOR_VERSION should also be checked).

diff -ruN ibm_db-1.0-old/ibm_db.h ibm_db-1.0-new/ibm_db.h
--- ibm_db-1.0-old/ibm_db.h     2009-05-21 07:59:01.000000000 +0200
+++ ibm_db-1.0-new/ibm_db.h     2010-01-27 13:30:14.000000000 +0100
@@ -16,6 +16,11 @@
 #include <Python.h>
 #include <structmember.h>

+/* Fix for non-existent Py_ssize_t type in Python 2.4 */
+#if PY_MINOR_VERSION == 4
+#define Py_ssize_t int
+#endif
+
 #define NUM2LONG(data) PyInt_AsLong(data)
 #define STR2CSTR(data) PyString_AsString(data)
 #define NIL_P(ptr) (ptr == NULL)

Original issue reported on code.google.com by Rafal.Le...@gmail.com on 28 Jan 2010 at 2:32

GoogleCodeExporter commented 9 years ago
Thanks for your patch. But we don't support python-2.4, and currently there is 
no
plan to support python-2.4.

Original comment by rahul.pr...@in.ibm.com on 29 Jan 2010 at 12:46