Skip to content
Permalink
Browse files

updated for version 7.3.711

Problem:    vim.current.buffer is not available. (lilydjwg)
Solution:   Use py3_PyUnicode_AsUTF8 instead of py3_PyUnicode_AsUTF8String.
            (Ken Takata)
  • Loading branch information...
brammool committed Oct 23, 2012
1 parent 12a753a commit 9c9cbf13511522c05e8cc8d038a858608a158533
Showing with 17 additions and 15 deletions.
  1. +15 −15 src/if_python3.c
  2. +2 −0 src/version.c
@@ -176,7 +176,7 @@ static void init_structs(void);
# define PyImport_AppendInittab py3_PyImport_AppendInittab
# if PY_VERSION_HEX >= 0x030300f0
# undef _PyUnicode_AsString
# define _PyUnicode_AsString py3_PyUnicode_AsUTF8String
# define _PyUnicode_AsString py3_PyUnicode_AsUTF8
# else
# define _PyUnicode_AsString py3__PyUnicode_AsString
# endif
@@ -286,11 +286,11 @@ static PyObject* py3__Py_FalseStruct;
static PyObject* py3__Py_TrueStruct;
static int (*py3_PyModule_AddObject)(PyObject *m, const char *name, PyObject *o);
static int (*py3_PyImport_AppendInittab)(const char *name, PyObject* (*initfunc)(void));
#if PY_VERSION_HEX >= 0x030300f0
static char* (*py3_PyUnicode_AsUTF8String)(PyObject *unicode);
#else
# if PY_VERSION_HEX >= 0x030300f0
static char* (*py3_PyUnicode_AsUTF8)(PyObject *unicode);
# else
static char* (*py3__PyUnicode_AsString)(PyObject *unicode);
#endif
# endif
static PyObject* (*py3_PyUnicode_AsEncodedString)(PyObject *unicode, const char* encoding, const char* errors);
static char* (*py3_PyBytes_AsString)(PyObject *bytes);
static int (*py3_PyBytes_AsStringAndSize)(PyObject *bytes, char **buffer, int *length);
@@ -348,13 +348,13 @@ static struct
{"PySys_SetArgv", (PYTHON_PROC*)&py3_PySys_SetArgv},
{"Py_SetPythonHome", (PYTHON_PROC*)&py3_Py_SetPythonHome},
{"Py_Initialize", (PYTHON_PROC*)&py3_Py_Initialize},
#ifndef PY_SSIZE_T_CLEAN
# ifndef PY_SSIZE_T_CLEAN
{"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
{"Py_BuildValue", (PYTHON_PROC*)&py3_Py_BuildValue},
#else
# else
{"_PyArg_ParseTuple_SizeT", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
{"_Py_BuildValue_SizeT", (PYTHON_PROC*)&py3_Py_BuildValue},
#endif
# endif
{"PyMem_Free", (PYTHON_PROC*)&py3_PyMem_Free},
{"PyMem_Malloc", (PYTHON_PROC*)&py3_PyMem_Malloc},
{"PyList_New", (PYTHON_PROC*)&py3_PyList_New},
@@ -406,11 +406,11 @@ static struct
{"PyObject_Init", (PYTHON_PROC*)&py3__PyObject_Init},
{"PyModule_AddObject", (PYTHON_PROC*)&py3_PyModule_AddObject},
{"PyImport_AppendInittab", (PYTHON_PROC*)&py3_PyImport_AppendInittab},
#if PY_VERSION_HEX >= 0x030300f0
{"PyUnicode_AsUTF8String", (PYTHON_PROC*)&py3_PyUnicode_AsUTF8String},
#else
# if PY_VERSION_HEX >= 0x030300f0
{"PyUnicode_AsUTF8", (PYTHON_PROC*)&py3_PyUnicode_AsUTF8},
# else
{"_PyUnicode_AsString", (PYTHON_PROC*)&py3__PyUnicode_AsString},
#endif
# endif
{"PyBytes_AsString", (PYTHON_PROC*)&py3_PyBytes_AsString},
{"PyBytes_AsStringAndSize", (PYTHON_PROC*)&py3_PyBytes_AsStringAndSize},
{"PyBytes_FromString", (PYTHON_PROC*)&py3_PyBytes_FromString},
@@ -503,12 +503,12 @@ py3_runtime_link_init(char *libname, int verbose)

/* Load unicode functions separately as only the ucs2 or the ucs4 functions
* will be present in the library. */
#if PY_VERSION_HEX >= 0x030300f0
# if PY_VERSION_HEX >= 0x030300f0
ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicode_FromString");
ucs_decode = symbol_from_dll(hinstPy3, "PyUnicode_Decode");
ucs_as_encoded_string = symbol_from_dll(hinstPy3,
"PyUnicode_AsEncodedString");
#else
# else
ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicodeUCS2_FromString");
ucs_decode = symbol_from_dll(hinstPy3,
"PyUnicodeUCS2_Decode");
@@ -523,7 +523,7 @@ py3_runtime_link_init(char *libname, int verbose)
ucs_as_encoded_string = symbol_from_dll(hinstPy3,
"PyUnicodeUCS4_AsEncodedString");
}
#endif
# endif
if (ucs_from_string && ucs_decode && ucs_as_encoded_string)
{
py3_PyUnicode_FromString = ucs_from_string;
@@ -725,6 +725,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
711,
/**/
710,
/**/

0 comments on commit 9c9cbf1

Please sign in to comment.
You can’t perform that action at this time.