Permalink
Browse files

use '%lld' format for Py_ssize_t on Win64+MSVC if supported

  • Loading branch information...
1 parent ab9ca87 commit b46f58d6348f5f858a1724d94213c5c619bf0ca5 @scoder scoder committed Aug 31, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 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

0 comments on commit b46f58d

Please sign in to comment.