diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-04 13:33:00 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-04 13:33:00 (GMT) |
commit | c36625b05df8cf35946a16c1e47faac4d5b5ea00 (patch) | |
tree | 8985757b5009c9efd3811450cb714ea51f596015 /PC | |
parent | 8fd7b0c1a790158a2ab42f70c6c16636f75a4de8 (diff) | |
download | cpython-c36625b05df8cf35946a16c1e47faac4d5b5ea00.zip cpython-c36625b05df8cf35946a16c1e47faac4d5b5ea00.tar.gz cpython-c36625b05df8cf35946a16c1e47faac4d5b5ea00.tar.bz2 |
Some VS 6.0 compatibility fixes from Hirokazu Yamamoto which are also useful for later versions of MSVC. VS6 claims that fortran is a reserved word
Diffstat (limited to 'PC')
-rwxr-xr-x | PC/msvcrtmodule.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c index a137ed0..eeee99f 100755 --- a/PC/msvcrtmodule.c +++ b/PC/msvcrtmodule.c @@ -145,6 +145,7 @@ msvcrt_getch(PyObject *self, PyObject *args) return PyString_FromStringAndSize(s, 1); } +#if _MSC_VER >= 1300 static PyObject * msvcrt_getwch(PyObject *self, PyObject *args) { @@ -160,6 +161,7 @@ msvcrt_getwch(PyObject *self, PyObject *args) u[0] = ch; return PyUnicode_FromUnicode(u, 1); } +#endif static PyObject * msvcrt_getche(PyObject *self, PyObject *args) @@ -177,6 +179,7 @@ msvcrt_getche(PyObject *self, PyObject *args) return PyString_FromStringAndSize(s, 1); } +#if _MSC_VER >= 1300 static PyObject * msvcrt_getwche(PyObject *self, PyObject *args) { @@ -192,6 +195,7 @@ msvcrt_getwche(PyObject *self, PyObject *args) s[0] = ch; return PyUnicode_FromUnicode(s, 1); } +#endif static PyObject * msvcrt_putch(PyObject *self, PyObject *args) @@ -207,6 +211,7 @@ msvcrt_putch(PyObject *self, PyObject *args) } +#if _MSC_VER >= 1300 static PyObject * msvcrt_putwch(PyObject *self, PyObject *args) { @@ -225,6 +230,7 @@ msvcrt_putwch(PyObject *self, PyObject *args) Py_RETURN_NONE; } +#endif static PyObject * msvcrt_ungetch(PyObject *self, PyObject *args) @@ -240,6 +246,7 @@ msvcrt_ungetch(PyObject *self, PyObject *args) return Py_None; } +#if _MSC_VER >= 1300 static PyObject * msvcrt_ungetwch(PyObject *self, PyObject *args) { @@ -253,6 +260,7 @@ msvcrt_ungetwch(PyObject *self, PyObject *args) Py_INCREF(Py_None); return Py_None; } +#endif static void insertint(PyObject *d, char *name, int value) @@ -341,10 +349,12 @@ static struct PyMethodDef msvcrt_functions[] = { {"CrtSetReportMode", msvcrt_setreportmode, METH_VARARGS}, {"set_error_mode", msvcrt_seterrormode, METH_VARARGS}, #endif +#if _MSC_VER >= 1300 {"getwch", msvcrt_getwch, METH_VARARGS}, {"getwche", msvcrt_getwche, METH_VARARGS}, {"putwch", msvcrt_putwch, METH_VARARGS}, {"ungetwch", msvcrt_ungetwch, METH_VARARGS}, +#endif {NULL, NULL} }; |