summaryrefslogtreecommitdiffstats
path: root/Include/pyport.h
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-09-25 06:58:00 (GMT)
committerGeorg Brandl <georg@python.org>2006-09-25 06:58:00 (GMT)
commit934c90de0de8a0fd5f07b483b18d98beb857dbd9 (patch)
tree29264686d9cda5c7c1d945b2d3bc5c97ff843786 /Include/pyport.h
parentb14b59fcf9325bc803763c4aad036cb12f9d7978 (diff)
downloadcpython-934c90de0de8a0fd5f07b483b18d98beb857dbd9.zip
cpython-934c90de0de8a0fd5f07b483b18d98beb857dbd9.tar.gz
cpython-934c90de0de8a0fd5f07b483b18d98beb857dbd9.tar.bz2
Backport rev. 51971:
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.
Diffstat (limited to 'Include/pyport.h')
-rw-r--r--Include/pyport.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index be6c51f..8f8e514 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -126,7 +126,7 @@ typedef Py_intptr_t Py_ssize_t;
* Py_ssize_t on the platform.
*/
#ifndef PY_FORMAT_SIZE_T
-# if SIZEOF_SIZE_T == SIZEOF_INT
+# if SIZEOF_SIZE_T == SIZEOF_INT && !defined(__APPLE__)
# define PY_FORMAT_SIZE_T ""
# elif SIZEOF_SIZE_T == SIZEOF_LONG
# define PY_FORMAT_SIZE_T "l"