summaryrefslogtreecommitdiff
path: root/psycopg/python.h
diff options
context:
space:
mode:
authorFederico Di Gregorio <fog@initd.org>2011-02-27 13:03:48 +0100
committerFederico Di Gregorio <fog@initd.org>2011-02-27 13:03:48 +0100
commit29f83f05c4f6565ea67d8b5424b1ec66d55c0858 (patch)
tree7c865edb4ee65754261b7087afce369c588f18b4 /psycopg/python.h
parent3762c67cd474880b42a14d81903c4d9dcf9a7063 (diff)
parent2212ea96a69dec8a0cbb60cccfbd48b244635249 (diff)
downloadpsycopg2-29f83f05c4f6565ea67d8b5424b1ec66d55c0858.tar.gz
Merge branch 'devel'2_4_0
Diffstat (limited to 'psycopg/python.h')
-rw-r--r--psycopg/python.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/psycopg/python.h b/psycopg/python.h
index c3f9a0d..fed0303 100644
--- a/psycopg/python.h
+++ b/psycopg/python.h
@@ -54,6 +54,15 @@
#define CONV_CODE_PY_SSIZE_T "n"
#endif
+/* hash() return size changed around version 3.2a4 on 64bit platforms. Before
+ * this, the return size was always a long, regardless of arch. ~3.2
+ * introduced the Py_hash_t & Py_uhash_t typedefs with the resulting sizes
+ * based upon arch. */
+#if PY_VERSION_HEX < 0x030200A4
+typedef long Py_hash_t;
+typedef unsigned long Py_uhash_t;
+#endif
+
/* Macros defined in Python 2.6 */
#ifndef Py_REFCNT
#define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)