forked from aniani/vim
updated for version 7.3.1040
Problem: Python: Problems with debugging dynamic build. Solution: Python patch 1. (ZyX)
This commit is contained in:
@@ -21,6 +21,15 @@
|
|||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
|
/* uncomment this if used with the debug version of python.
|
||||||
|
* Checked on 2.7.4. */
|
||||||
|
/* #define Py_DEBUG */
|
||||||
|
/* 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
|
||||||
|
* allocator */
|
||||||
|
/* #define Py_DEBUG_NO_PYMALLOC */
|
||||||
|
|
||||||
/* Python.h defines _POSIX_THREADS itself (if needed) */
|
/* Python.h defines _POSIX_THREADS itself (if needed) */
|
||||||
#ifdef _POSIX_THREADS
|
#ifdef _POSIX_THREADS
|
||||||
# undef _POSIX_THREADS
|
# undef _POSIX_THREADS
|
||||||
@@ -240,8 +249,18 @@ struct PyMethodDef { Py_ssize_t a; };
|
|||||||
# define PyType_IsSubtype dll_PyType_IsSubtype
|
# define PyType_IsSubtype dll_PyType_IsSubtype
|
||||||
# endif
|
# endif
|
||||||
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
|
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
|
||||||
# define PyObject_Malloc dll_PyObject_Malloc
|
# ifdef Py_DEBUG
|
||||||
# define PyObject_Free dll_PyObject_Free
|
# define _Py_NegativeRefcount dll__Py_NegativeRefcount
|
||||||
|
# define _Py_RefTotal (*dll__Py_RefTotal)
|
||||||
|
# define _Py_Dealloc dll__Py_Dealloc
|
||||||
|
# endif
|
||||||
|
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
|
||||||
|
# define _PyObject_DebugMalloc dll__PyObject_DebugMalloc
|
||||||
|
# define _PyObject_DebugFree dll__PyObject_DebugFree
|
||||||
|
# else
|
||||||
|
# define PyObject_Malloc dll_PyObject_Malloc
|
||||||
|
# define PyObject_Free dll_PyObject_Free
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# ifdef PY_USE_CAPSULE
|
# ifdef PY_USE_CAPSULE
|
||||||
# define PyCapsule_New dll_PyCapsule_New
|
# define PyCapsule_New dll_PyCapsule_New
|
||||||
@@ -350,8 +369,18 @@ static PyObject* dll__Py_TrueStruct;
|
|||||||
static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *);
|
static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *);
|
||||||
# endif
|
# endif
|
||||||
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
|
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
|
||||||
|
# ifdef Py_DEBUG
|
||||||
|
static void (*dll__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op);
|
||||||
|
static Py_ssize_t* dll__Py_RefTotal;
|
||||||
|
static void (*dll__Py_Dealloc)(PyObject *obj);
|
||||||
|
# endif
|
||||||
|
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
|
||||||
|
static void (*dll__PyObject_DebugFree)(void*);
|
||||||
|
static void* (*dll__PyObject_DebugMalloc)(size_t);
|
||||||
|
# else
|
||||||
static void* (*dll_PyObject_Malloc)(size_t);
|
static void* (*dll_PyObject_Malloc)(size_t);
|
||||||
static void (*dll_PyObject_Free)(void*);
|
static void (*dll_PyObject_Free)(void*);
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# ifdef PY_USE_CAPSULE
|
# ifdef PY_USE_CAPSULE
|
||||||
static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
|
static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
|
||||||
@@ -469,12 +498,6 @@ static struct
|
|||||||
{"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type},
|
{"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type},
|
||||||
{"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready},
|
{"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready},
|
||||||
{"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod},
|
{"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod},
|
||||||
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \
|
|
||||||
&& SIZEOF_SIZE_T != SIZEOF_INT
|
|
||||||
{"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4},
|
|
||||||
# else
|
|
||||||
{"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
|
|
||||||
# endif
|
|
||||||
{"Py_SetPythonHome", (PYTHON_PROC*)&dll_Py_SetPythonHome},
|
{"Py_SetPythonHome", (PYTHON_PROC*)&dll_Py_SetPythonHome},
|
||||||
{"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize},
|
{"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize},
|
||||||
{"Py_Finalize", (PYTHON_PROC*)&dll_Py_Finalize},
|
{"Py_Finalize", (PYTHON_PROC*)&dll_Py_Finalize},
|
||||||
@@ -496,8 +519,32 @@ static struct
|
|||||||
{"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype},
|
{"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype},
|
||||||
# endif
|
# endif
|
||||||
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
|
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000
|
||||||
|
# ifdef Py_DEBUG
|
||||||
|
{"_Py_NegativeRefcount", (PYTHON_PROC*)&dll__Py_NegativeRefcount},
|
||||||
|
{"_Py_RefTotal", (PYTHON_PROC*)&dll__Py_RefTotal},
|
||||||
|
{"_Py_Dealloc", (PYTHON_PROC*)&dll__Py_Dealloc},
|
||||||
|
# endif
|
||||||
|
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
|
||||||
|
{"_PyObject_DebugFree", (PYTHON_PROC*)&dll__PyObject_DebugFree},
|
||||||
|
{"_PyObject_DebugMalloc", (PYTHON_PROC*)&dll__PyObject_DebugMalloc},
|
||||||
|
# else
|
||||||
{"PyObject_Malloc", (PYTHON_PROC*)&dll_PyObject_Malloc},
|
{"PyObject_Malloc", (PYTHON_PROC*)&dll_PyObject_Malloc},
|
||||||
{"PyObject_Free", (PYTHON_PROC*)&dll_PyObject_Free},
|
{"PyObject_Free", (PYTHON_PROC*)&dll_PyObject_Free},
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \
|
||||||
|
&& SIZEOF_SIZE_T != SIZEOF_INT
|
||||||
|
# ifdef Py_DEBUG
|
||||||
|
{"Py_InitModule4TraceRefs_64", (PYTHON_PROC*)&dll_Py_InitModule4},
|
||||||
|
# else
|
||||||
|
{"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4},
|
||||||
|
# endif
|
||||||
|
# else
|
||||||
|
# ifdef Py_DEBUG
|
||||||
|
{"Py_InitModule4TraceRefs", (PYTHON_PROC*)&dll_Py_InitModule4},
|
||||||
|
# else
|
||||||
|
{"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4},
|
||||||
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# ifdef PY_USE_CAPSULE
|
# ifdef PY_USE_CAPSULE
|
||||||
{"PyCapsule_New", (PYTHON_PROC*)&dll_PyCapsule_New},
|
{"PyCapsule_New", (PYTHON_PROC*)&dll_PyCapsule_New},
|
||||||
|
@@ -24,6 +24,11 @@
|
|||||||
|
|
||||||
/* uncomment this if used with the debug version of python */
|
/* uncomment this if used with the debug version of python */
|
||||||
/* #define Py_DEBUG */
|
/* #define Py_DEBUG */
|
||||||
|
/* 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
|
||||||
|
* allocator */
|
||||||
|
/* #define Py_DEBUG_NO_PYMALLOC */
|
||||||
|
|
||||||
#include "vim.h"
|
#include "vim.h"
|
||||||
|
|
||||||
@@ -207,6 +212,11 @@
|
|||||||
# define _Py_NegativeRefcount py3__Py_NegativeRefcount
|
# define _Py_NegativeRefcount py3__Py_NegativeRefcount
|
||||||
# define _Py_RefTotal (*py3__Py_RefTotal)
|
# define _Py_RefTotal (*py3__Py_RefTotal)
|
||||||
# define _Py_Dealloc py3__Py_Dealloc
|
# define _Py_Dealloc py3__Py_Dealloc
|
||||||
|
# define PyModule_Create2TraceRefs py3_PyModule_Create2TraceRefs
|
||||||
|
# else
|
||||||
|
# define PyModule_Create2 py3_PyModule_Create2
|
||||||
|
# endif
|
||||||
|
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
|
||||||
# define _PyObject_DebugMalloc py3__PyObject_DebugMalloc
|
# define _PyObject_DebugMalloc py3__PyObject_DebugMalloc
|
||||||
# define _PyObject_DebugFree py3__PyObject_DebugFree
|
# define _PyObject_DebugFree py3__PyObject_DebugFree
|
||||||
# else
|
# else
|
||||||
@@ -218,7 +228,6 @@
|
|||||||
# define PyObject_GC_UnTrack py3_PyObject_GC_UnTrack
|
# define PyObject_GC_UnTrack py3_PyObject_GC_UnTrack
|
||||||
# define PyType_GenericAlloc py3_PyType_GenericAlloc
|
# define PyType_GenericAlloc py3_PyType_GenericAlloc
|
||||||
# define PyType_GenericNew py3_PyType_GenericNew
|
# define PyType_GenericNew py3_PyType_GenericNew
|
||||||
# define PyModule_Create2 py3_PyModule_Create2
|
|
||||||
# undef PyUnicode_FromString
|
# undef PyUnicode_FromString
|
||||||
# define PyUnicode_FromString py3_PyUnicode_FromString
|
# define PyUnicode_FromString py3_PyUnicode_FromString
|
||||||
# undef PyUnicode_Decode
|
# undef PyUnicode_Decode
|
||||||
@@ -227,7 +236,7 @@
|
|||||||
# define PyCapsule_New py3_PyCapsule_New
|
# define PyCapsule_New py3_PyCapsule_New
|
||||||
# define PyCapsule_GetPointer py3_PyCapsule_GetPointer
|
# define PyCapsule_GetPointer py3_PyCapsule_GetPointer
|
||||||
|
|
||||||
# ifdef Py_DEBUG
|
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
|
||||||
# undef PyObject_NEW
|
# undef PyObject_NEW
|
||||||
# define PyObject_NEW(type, typeobj) \
|
# define PyObject_NEW(type, typeobj) \
|
||||||
( (type *) PyObject_Init( \
|
( (type *) PyObject_Init( \
|
||||||
@@ -317,7 +326,6 @@ static PyObject* (*py3_PyBytes_FromString)(char *str);
|
|||||||
static PyObject* (*py3_PyFloat_FromDouble)(double num);
|
static PyObject* (*py3_PyFloat_FromDouble)(double num);
|
||||||
static double (*py3_PyFloat_AsDouble)(PyObject *);
|
static double (*py3_PyFloat_AsDouble)(PyObject *);
|
||||||
static PyObject* (*py3_PyObject_GenericGetAttr)(PyObject *obj, PyObject *name);
|
static PyObject* (*py3_PyObject_GenericGetAttr)(PyObject *obj, PyObject *name);
|
||||||
static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version);
|
|
||||||
static PyObject* (*py3_PyType_GenericAlloc)(PyTypeObject *type, Py_ssize_t nitems);
|
static PyObject* (*py3_PyType_GenericAlloc)(PyTypeObject *type, Py_ssize_t nitems);
|
||||||
static PyObject* (*py3_PyType_GenericNew)(PyTypeObject *type, PyObject *args, PyObject *kwds);
|
static PyObject* (*py3_PyType_GenericNew)(PyTypeObject *type, PyObject *args, PyObject *kwds);
|
||||||
static PyTypeObject* py3_PyType_Type;
|
static PyTypeObject* py3_PyType_Type;
|
||||||
@@ -328,14 +336,19 @@ static PyObject* (*py3_PyErr_NewException)(char *name, PyObject *base, PyObject
|
|||||||
static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
|
static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
|
||||||
static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *);
|
static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *);
|
||||||
# ifdef Py_DEBUG
|
# ifdef Py_DEBUG
|
||||||
static void (*py3__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op);
|
static void (*py3__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op);
|
||||||
static Py_ssize_t* py3__Py_RefTotal;
|
static Py_ssize_t* py3__Py_RefTotal;
|
||||||
static void (*py3__Py_Dealloc)(PyObject *obj);
|
static void (*py3__Py_Dealloc)(PyObject *obj);
|
||||||
static void (*py3__PyObject_DebugFree)(void*);
|
static PyObject* (*py3_PyModule_Create2TraceRefs)(struct PyModuleDef* module, int module_api_version);
|
||||||
static void* (*py3__PyObject_DebugMalloc)(size_t);
|
|
||||||
# else
|
# else
|
||||||
static void (*py3_PyObject_Free)(void*);
|
static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version);
|
||||||
static void* (*py3_PyObject_Malloc)(size_t);
|
# endif
|
||||||
|
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
|
||||||
|
static void (*py3__PyObject_DebugFree)(void*);
|
||||||
|
static void* (*py3__PyObject_DebugMalloc)(size_t);
|
||||||
|
# else
|
||||||
|
static void (*py3_PyObject_Free)(void*);
|
||||||
|
static void* (*py3_PyObject_Malloc)(size_t);
|
||||||
# endif
|
# endif
|
||||||
static PyObject*(*py3__PyObject_GC_New)(PyTypeObject *);
|
static PyObject*(*py3__PyObject_GC_New)(PyTypeObject *);
|
||||||
static void(*py3_PyObject_GC_Del)(void *);
|
static void(*py3_PyObject_GC_Del)(void *);
|
||||||
@@ -451,7 +464,6 @@ static struct
|
|||||||
{"PyFloat_FromDouble", (PYTHON_PROC*)&py3_PyFloat_FromDouble},
|
{"PyFloat_FromDouble", (PYTHON_PROC*)&py3_PyFloat_FromDouble},
|
||||||
{"PyFloat_AsDouble", (PYTHON_PROC*)&py3_PyFloat_AsDouble},
|
{"PyFloat_AsDouble", (PYTHON_PROC*)&py3_PyFloat_AsDouble},
|
||||||
{"PyObject_GenericGetAttr", (PYTHON_PROC*)&py3_PyObject_GenericGetAttr},
|
{"PyObject_GenericGetAttr", (PYTHON_PROC*)&py3_PyObject_GenericGetAttr},
|
||||||
{"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2},
|
|
||||||
{"PyType_GenericAlloc", (PYTHON_PROC*)&py3_PyType_GenericAlloc},
|
{"PyType_GenericAlloc", (PYTHON_PROC*)&py3_PyType_GenericAlloc},
|
||||||
{"PyType_GenericNew", (PYTHON_PROC*)&py3_PyType_GenericNew},
|
{"PyType_GenericNew", (PYTHON_PROC*)&py3_PyType_GenericNew},
|
||||||
{"PyType_Type", (PYTHON_PROC*)&py3_PyType_Type},
|
{"PyType_Type", (PYTHON_PROC*)&py3_PyType_Type},
|
||||||
@@ -463,6 +475,11 @@ static struct
|
|||||||
{"_Py_NegativeRefcount", (PYTHON_PROC*)&py3__Py_NegativeRefcount},
|
{"_Py_NegativeRefcount", (PYTHON_PROC*)&py3__Py_NegativeRefcount},
|
||||||
{"_Py_RefTotal", (PYTHON_PROC*)&py3__Py_RefTotal},
|
{"_Py_RefTotal", (PYTHON_PROC*)&py3__Py_RefTotal},
|
||||||
{"_Py_Dealloc", (PYTHON_PROC*)&py3__Py_Dealloc},
|
{"_Py_Dealloc", (PYTHON_PROC*)&py3__Py_Dealloc},
|
||||||
|
{"PyModule_Create2TraceRefs", (PYTHON_PROC*)&py3_PyModule_Create2TraceRefs},
|
||||||
|
# else
|
||||||
|
{"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2},
|
||||||
|
# endif
|
||||||
|
# if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
|
||||||
{"_PyObject_DebugFree", (PYTHON_PROC*)&py3__PyObject_DebugFree},
|
{"_PyObject_DebugFree", (PYTHON_PROC*)&py3__PyObject_DebugFree},
|
||||||
{"_PyObject_DebugMalloc", (PYTHON_PROC*)&py3__PyObject_DebugMalloc},
|
{"_PyObject_DebugMalloc", (PYTHON_PROC*)&py3__PyObject_DebugMalloc},
|
||||||
# else
|
# else
|
||||||
@@ -656,7 +673,7 @@ static int py3initialised = 0;
|
|||||||
static void
|
static void
|
||||||
call_PyObject_Free(void *p)
|
call_PyObject_Free(void *p)
|
||||||
{
|
{
|
||||||
#ifdef Py_DEBUG
|
#if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC)
|
||||||
_PyObject_DebugFree(p);
|
_PyObject_DebugFree(p);
|
||||||
#else
|
#else
|
||||||
PyObject_Free(p);
|
PyObject_Free(p);
|
||||||
|
@@ -728,6 +728,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1040,
|
||||||
/**/
|
/**/
|
||||||
1039,
|
1039,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user