summaryrefslogtreecommitdiffstats
path: root/Include/pyport.h
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-09-22 08:16:26 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-09-22 08:16:26 (GMT)
commit4a8fbdb1b2172e1954e652be7dda74d188a00fa5 (patch)
tree8332714795b9aed78dac71751f9ac2e5462b9980 /Include/pyport.h
parentd10a0f776602cc43491b77b7daa68d55bc340ad6 (diff)
downloadcpython-4a8fbdb1b2172e1954e652be7dda74d188a00fa5.zip
cpython-4a8fbdb1b2172e1954e652be7dda74d188a00fa5.tar.gz
cpython-4a8fbdb1b2172e1954e652be7dda74d188a00fa5.tar.bz2
Fix %zd string formatting on Mac OS X so it prints negative numbers.
In addition to testing positive numbers, verify negative numbers work in configure. In order to avoid compiler warnings on OS X 10.4, also change the order of the check for the format character to use (PY_FORMAT_SIZE_T) in the sprintf format for Py_ssize_t. This patch changes PY_FORMAT_SIZE_T from "" to "l" if it wasn't defined at configure time. Need to verify the buildbot results. Backport candidate (if everyone thinks this patch can't be improved).
Diffstat (limited to 'Include/pyport.h')
-rw-r--r--Include/pyport.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index be6c51f..16ee011 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -126,10 +126,10 @@ typedef Py_intptr_t Py_ssize_t;
* Py_ssize_t on the platform.
*/
#ifndef PY_FORMAT_SIZE_T
-# if SIZEOF_SIZE_T == SIZEOF_INT
-# define PY_FORMAT_SIZE_T ""
-# elif SIZEOF_SIZE_T == SIZEOF_LONG
+# if SIZEOF_SIZE_T == SIZEOF_LONG
# define PY_FORMAT_SIZE_T "l"
+# elif SIZEOF_SIZE_T == SIZEOF_INT
+# define PY_FORMAT_SIZE_T ""
# elif defined(MS_WINDOWS)
# define PY_FORMAT_SIZE_T "I"
# else