Mercurial > vim
changeset 4988:e130cc3d17af v7.3.1239
updated for version 7.3.1239
Problem: Can't build with Python and MSVC10.
Solution: Move #if outside of macro. (Taro Muraoka)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Mon, 24 Jun 2013 21:21:58 +0200 |
parents | 9429c1cbd9d4 |
children | ba58aea77547 |
files | .hgignore src/if_py_both.h src/version.c |
diffstat | 3 files changed, 17 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore +++ b/.hgignore @@ -38,6 +38,9 @@ src/Obj*/pathdef.c gvimext.dll gvimext.lib +# Mac OSX +src/xxd/xxd.dSYM + # All platforms *.rej *.orig
--- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -139,13 +139,15 @@ StringToChars(PyObject *obj, PyObject ** } else { +#if PY_MAJOR_VERSION < 3 PyErr_FORMAT(PyExc_TypeError, -#if PY_MAJOR_VERSION < 3 - N_("expected str() or unicode() instance, but got %s") + N_("expected str() or unicode() instance, but got %s"), + Py_TYPE_NAME(obj)); #else - N_("expected bytes() or str() instance, but got %s") + PyErr_FORMAT(PyExc_TypeError, + N_("expected bytes() or str() instance, but got %s"), + Py_TYPE_NAME(obj)); #endif - , Py_TYPE_NAME(obj)); return NULL; } @@ -191,15 +193,17 @@ NumberToLong(PyObject *obj, long *result } else { +#if PY_MAJOR_VERSION < 3 PyErr_FORMAT(PyExc_TypeError, -#if PY_MAJOR_VERSION < 3 N_("expected int(), long() or something supporting " - "coercing to long(), but got %s") + "coercing to long(), but got %s"), + Py_TYPE_NAME(obj)); #else + PyErr_FORMAT(PyExc_TypeError, N_("expected int() or something supporting coercing to int(), " - "but got %s") + "but got %s"), + Py_TYPE_NAME(obj)); #endif - , Py_TYPE_NAME(obj)); return -1; }