summaryrefslogtreecommitdiff
path: root/src/if_python.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-05-30 15:38:24 +0200
committerBram Moolenaar <Bram@vim.org>2013-05-30 15:38:24 +0200
commitfdde880b0288fd9624352aa7ee5c04eefbdff9df (patch)
tree35eb921887946e22fe77042cd41c1ada2a3019b3 /src/if_python.c
parentfc714b35c6dd691adfc15782d663c0a1a07a0da8 (diff)
downloadvim-git-fdde880b0288fd9624352aa7ee5c04eefbdff9df.tar.gz
updated for version 7.3.1070v7.3.1070
Problem: Vim crashes in Python tests. Compiler warning for unused function. Solution: Disable the tests for now. Move the function.
Diffstat (limited to 'src/if_python.c')
-rw-r--r--src/if_python.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/if_python.c b/src/if_python.c
index cf2ab9aa2..a1291d736 100644
--- a/src/if_python.c
+++ b/src/if_python.c
@@ -737,6 +737,21 @@ static PyObject *FunctionGetattr(PyObject *, char *);
}
#endif
+#if defined(HAVE_LOCALE_H) || defined(X_LOCALE)
+ static void *
+py_memsave(void *p, size_t len)
+{
+ void *r;
+
+ if (!(r = PyMem_Malloc(len)))
+ return NULL;
+ mch_memmove(r, p, len);
+ return r;
+}
+
+# define PY_STRSAVE(s) ((char_u *) py_memsave(s, STRLEN(s) + 1))
+#endif
+
/*
* Include the code shared with if_python3.c
*/