comparison src/if_python.c @ 4823:46077370bc60 v7.3.1158

updated for version 7.3.1158 Problem: Crash when running test 86. (Jun Takimoto) Solution: Define PY_SSIZE_T_CLEAN early. (Elimar Riesebieter)
author Bram Moolenaar <bram@vim.org>
date Mon, 10 Jun 2013 18:36:24 +0200
parents 542af01979be
children b8eabb6a9687
comparison
equal deleted inserted replaced
4822:03ac6cd5cac6 4823:46077370bc60
51 #endif 51 #endif
52 #ifdef _XOPEN_SOURCE 52 #ifdef _XOPEN_SOURCE
53 # undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */ 53 # undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */
54 #endif 54 #endif
55 55
56 #define PY_SSIZE_T_CLEAN
57
56 #include <Python.h> 58 #include <Python.h>
59
60 #if !defined(PY_VERSION_HEX) || PY_VERSION_HEX < 0x02050000
61 # undef PY_SSIZE_T_CLEAN
62 #endif
63
57 #if defined(MACOS) && !defined(MACOS_X_UNIX) 64 #if defined(MACOS) && !defined(MACOS_X_UNIX)
58 # include "macglue.h" 65 # include "macglue.h"
59 # include <CodeFragments.h> 66 # include <CodeFragments.h>
60 #endif 67 #endif
61 #undef main /* Defined in python.h - aargh */ 68 #undef main /* Defined in python.h - aargh */
62 #undef HAVE_FCNTL_H /* Clash with os_win32.h */ 69 #undef HAVE_FCNTL_H /* Clash with os_win32.h */
63
64 #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000
65 # define PY_SSIZE_T_CLEAN
66 #endif
67 70
68 #define PyBytes_FromString PyString_FromString 71 #define PyBytes_FromString PyString_FromString
69 #define PyBytes_Check PyString_Check 72 #define PyBytes_Check PyString_Check
70 73
71 /* No-op conversion functions, use with care! */ 74 /* No-op conversion functions, use with care! */