summaryrefslogtreecommitdiffstats
path: root/Include/pyport.h
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-10-17 20:54:53 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-10-17 20:54:53 (GMT)
commit8f67d0893f7170986b0ad370844318544270cbcc (patch)
tree4aec6cf093d4d042d18d1fadc3ce52765d32bd8d /Include/pyport.h
parent6fb457526cef485d64f4f6744d81cae8c02032b3 (diff)
downloadcpython-8f67d0893f7170986b0ad370844318544270cbcc.zip
cpython-8f67d0893f7170986b0ad370844318544270cbcc.tar.gz
cpython-8f67d0893f7170986b0ad370844318544270cbcc.tar.bz2
make hashes always the size of pointers; introduce Py_hash_t #9778
Diffstat (limited to 'Include/pyport.h')
-rw-r--r--Include/pyport.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 5e98f0b..4331bf9 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -130,7 +130,7 @@ Used in: PY_LONG_LONG
_PyHash_Double in Objects/object.c. Numeric hashes are based on
reduction modulo the prime 2**_PyHASH_BITS - 1. */
-#if SIZEOF_LONG >= 8
+#if SIZEOF_VOID_P >= 8
#define _PyHASH_BITS 61
#else
#define _PyHASH_BITS 31
@@ -177,6 +177,9 @@ typedef Py_intptr_t Py_ssize_t;
# error "Python needs a typedef for Py_ssize_t in pyport.h."
#endif
+/* Py_hash_t is the same size as a pointer. */
+typedef Py_ssize_t Py_hash_t;
+
/* Largest possible value of size_t.
SIZE_MAX is part of C99, so it might be defined on some
platforms. If it is not defined, (size_t)-1 is a portable