]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Hopefully fix C extension on python2.4 (ticket #1781), however I can't test it
authorGaëtan de Menten <gdementen@gmail.com>
Mon, 26 Apr 2010 19:16:23 +0000 (21:16 +0200)
committerGaëtan de Menten <gdementen@gmail.com>
Mon, 26 Apr 2010 19:16:23 +0000 (21:16 +0200)
currently.

lib/sqlalchemy/cextension/processors.c
lib/sqlalchemy/cextension/resultproxy.c

index 6e33027194b3edd6daa061e5c003bf6a62b0337d..327462fa89dde110d297e78a5ce529fa48ea93aa 100644 (file)
@@ -9,6 +9,13 @@ the MIT License: http://www.opensource.org/licenses/mit-license.php
 #include <Python.h>
 #include <datetime.h>
 
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
+
 static PyObject *
 int_to_boolean(PyObject *self, PyObject *arg)
 {
index 50830b660fb529bff48182159098b429195c3b7c..400fd16fc630bdbfd6f1e00fb7f46694b8ff6fc3 100644 (file)
@@ -8,6 +8,12 @@ the MIT License: http://www.opensource.org/licenses/mit-license.php
 
 #include <Python.h>
 
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#endif
+
 
 /***********
  * Structs *