summaryrefslogtreecommitdiff
path: root/Cython/Utility/ModuleSetupCode.c
diff options
context:
space:
mode:
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