summaryrefslogtreecommitdiffstats
path: root/Include/pyport.h
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-02-15 17:27:45 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-02-15 17:27:45 (GMT)
commit18e165558b24d29e7e0ca501842b9236589b012a (patch)
tree841678b5dc1aff3aa48701fee33a6ba7be00a72b /Include/pyport.h
parent44829297348d9121a03fc7df2fac557b583cc7fa (diff)
downloadcpython-18e165558b24d29e7e0ca501842b9236589b012a.zip
cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.gz
cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.bz2
Merge ssize_t branch.
Diffstat (limited to 'Include/pyport.h')
-rw-r--r--Include/pyport.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 2440c55..f3ba488 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -85,6 +85,15 @@ typedef PY_LONG_LONG Py_intptr_t;
# error "Python needs a typedef for Py_uintptr_t in pyport.h."
#endif /* HAVE_UINTPTR_T */
+#ifdef HAVE_SSIZE_T
+typedef ssize_t Py_ssize_t;
+#elif SIZEOF_VOID_P == SIZEOF_SIZE_T
+typedef Py_uintptr_t Py_ssize_t;
+#else
+# error "Python needs a typedef for Py_ssize_t in pyport.h."
+#endif
+#define PY_SSIZE_T_MAX ((Py_ssize_t)(((size_t)-1)>>1))
+
#include <stdlib.h>
#include <math.h> /* Moved here from the math section, before extern "C" */