# HG changeset patch # User Bram Moolenaar # Date 1370882184 -7200 # Node ID 46077370bc605815f5e41cbfc925120a913acbaa # Parent 03ac6cd5cac6ee9557320e3f65fbab6eb9de39b6 updated for version 7.3.1158 Problem: Crash when running test 86. (Jun Takimoto) Solution: Define PY_SSIZE_T_CLEAN early. (Elimar Riesebieter) diff --git a/src/if_python.c b/src/if_python.c --- a/src/if_python.c +++ b/src/if_python.c @@ -53,7 +53,14 @@ # undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */ #endif +#define PY_SSIZE_T_CLEAN + #include + +#if !defined(PY_VERSION_HEX) || PY_VERSION_HEX < 0x02050000 +# undef PY_SSIZE_T_CLEAN +#endif + #if defined(MACOS) && !defined(MACOS_X_UNIX) # include "macglue.h" # include @@ -61,10 +68,6 @@ #undef main /* Defined in python.h - aargh */ #undef HAVE_FCNTL_H /* Clash with os_win32.h */ -#if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 -# define PY_SSIZE_T_CLEAN -#endif - #define PyBytes_FromString PyString_FromString #define PyBytes_Check PyString_Check diff --git a/src/if_python3.c b/src/if_python3.c --- a/src/if_python3.c +++ b/src/if_python3.c @@ -24,9 +24,9 @@ /* uncomment this if used with the debug version of python */ /* #define Py_DEBUG */ -/* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting +/* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting */ -/* uncomment this if used with the debug version of python, but without its +/* uncomment this if used with the debug version of python, but without its * allocator */ /* #define Py_DEBUG_NO_PYMALLOC */ @@ -61,7 +61,10 @@ # undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */ #endif +#define PY_SSIZE_T_CLEAN + #include + #if defined(MACOS) && !defined(MACOS_X_UNIX) # include "macglue.h" # include @@ -69,10 +72,6 @@ #undef main /* Defined in python.h - aargh */ #undef HAVE_FCNTL_H /* Clash with os_win32.h */ -#if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 -# define PY_SSIZE_T_CLEAN -#endif - /* The "surrogateescape" error handler is new in Python 3.1 */ #if PY_VERSION_HEX >= 0x030100f0 # define CODEC_ERROR_HANDLER "surrogateescape" diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -729,6 +729,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1158, +/**/ 1157, /**/ 1156,