summaryrefslogtreecommitdiff
path: root/Cython/Utility/ModuleSetupCode.c
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2012-08-31 07:10:36 +0200
committerStefan Behnel <stefan_ml@behnel.de>2012-08-31 07:10:36 +0200
commitb46f58d6348f5f858a1724d94213c5c619bf0ca5 (patch)
treedb604a16459109c12dec959223b8274067509e87 /Cython/Utility/ModuleSetupCode.c
parentab9ca875fa301b7fa42a7cf9fe715635661c5d93 (diff)
downloadcython-b46f58d6348f5f858a1724d94213c5c619bf0ca5.tar.gz
use '%lld' format for Py_ssize_t on Win64+MSVC if supported
Diffstat (limited to 'Cython/Utility/ModuleSetupCode.c')
-rw-r--r--Cython/Utility/ModuleSetupCode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Cython/Utility/ModuleSetupCode.c b/Cython/Utility/ModuleSetupCode.c
index 4094249b7..ef3f6d2b9 100644
--- a/Cython/Utility/ModuleSetupCode.c
+++ b/Cython/Utility/ModuleSetupCode.c
@@ -245,7 +245,13 @@
#endif
#if defined(_WIN64) && defined(_MSC_VER)
+ // CPython misdefines the format as "I", but the
+ // "ll" prefix is only supported in Py2.7 and later
+ #if PY_VERSION_HEX >= 0x02070000
+ #define CYTHON_FORMAT_SSIZE_T "ll"
+ #else
#define CYTHON_FORMAT_SSIZE_T "z"
+ #endif
#else
#define CYTHON_FORMAT_SSIZE_T PY_FORMAT_SIZE_T
#endif