diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-06-30 13:34:34 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-06-30 13:34:34 +0200 |
commit | 221d6872c432842534b302da4670014c29588566 (patch) | |
tree | 1abdf0dd64086b45df075e573229fe54c04436e6 /src | |
parent | e721122b792698096b1c7fd5641e61fa37231408 (diff) |
updated for version 7.3.584v7.3.584
Problem: PyCObject is not always defined.
Solution: Use PyObject instead.
Diffstat (limited to 'src')
-rw-r--r-- | src/if_py_both.h | 19 | ||||
-rw-r--r-- | src/if_python.c | 4 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 10 insertions, 15 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index 0912ee06df..530c6d86aa 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -2432,32 +2432,25 @@ typedef int (*pytotvfunc)(PyObject *, typval_T *, PyObject *); convert_dl(PyObject *obj, typval_T *tv, pytotvfunc py_to_tv, PyObject *lookupDict) { -# ifdef PY_USE_CAPSULE PyObject *capsule; -# else - PyCObject *cobject; -# endif char hexBuf[sizeof(void *) * 2 + 3]; sprintf(hexBuf, "%p", obj); # ifdef PY_USE_CAPSULE capsule = PyDict_GetItemString(lookupDict, hexBuf); - if (capsule == NULL) # else - cobject = (PyCObject *)PyDict_GetItemString(lookupDict, hexBuf); - if (cobject == NULL) + capsule = (PyObject *)PyDict_GetItemString(lookupDict, hexBuf); # endif + if (capsule == NULL) { # ifdef PY_USE_CAPSULE capsule = PyCapsule_New(tv, NULL, NULL); - PyDict_SetItemString(lookupDict, hexBuf, capsule); - Py_DECREF(capsule); # else - cobject = PyCObject_FromVoidPtr(tv, NULL); - PyDict_SetItemString(lookupDict, hexBuf, cobject); - Py_DECREF(cobject); + capsule = PyCObject_FromVoidPtr(tv, NULL); # endif + PyDict_SetItemString(lookupDict, hexBuf, capsule); + Py_DECREF(capsule); if (py_to_tv(obj, tv, lookupDict) == -1) { tv->v_type = VAR_UNKNOWN; @@ -2478,7 +2471,7 @@ convert_dl(PyObject *obj, typval_T *tv, # ifdef PY_USE_CAPSULE v = PyCapsule_GetPointer(capsule, NULL); # else - v = PyCObject_AsVoidPtr(cobject); + v = PyCObject_AsVoidPtr(capsule); # endif copy_tv(v, tv); } diff --git a/src/if_python.c b/src/if_python.c index 6674df7297..1740979ac7 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -327,8 +327,8 @@ static void (*dll_PyObject_Free)(void*); static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor); static void* (*dll_PyCapsule_GetPointer)(PyObject *, char *); # else -static PyCObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *)); -static void* (*dll_PyCObject_AsVoidPtr)(PyCObject *); +static PyObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *)); +static void* (*dll_PyCObject_AsVoidPtr)(PyObject *); # endif static HINSTANCE hinstPython = 0; /* Instance of python.dll */ diff --git a/src/version.c b/src/version.c index f9d2eda7c4..526669d22b 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 584, +/**/ 583, /**/ 582, |