@@ -145,6 +145,7 @@ msvcrt_getch(PyObject *self, PyObject *args)
145145 return PyString_FromStringAndSize (s , 1 );
146146}
147147
148+ #if _MSC_VER >= 1300
148149static PyObject *
149150msvcrt_getwch (PyObject * self , PyObject * args )
150151{
@@ -160,6 +161,7 @@ msvcrt_getwch(PyObject *self, PyObject *args)
160161 u [0 ] = ch ;
161162 return PyUnicode_FromUnicode (u , 1 );
162163}
164+ #endif
163165
164166static PyObject *
165167msvcrt_getche (PyObject * self , PyObject * args )
@@ -177,6 +179,7 @@ msvcrt_getche(PyObject *self, PyObject *args)
177179 return PyString_FromStringAndSize (s , 1 );
178180}
179181
182+ #if _MSC_VER >= 1300
180183static PyObject *
181184msvcrt_getwche (PyObject * self , PyObject * args )
182185{
@@ -192,6 +195,7 @@ msvcrt_getwche(PyObject *self, PyObject *args)
192195 s [0 ] = ch ;
193196 return PyUnicode_FromUnicode (s , 1 );
194197}
198+ #endif
195199
196200static PyObject *
197201msvcrt_putch (PyObject * self , PyObject * args )
@@ -207,6 +211,7 @@ msvcrt_putch(PyObject *self, PyObject *args)
207211}
208212
209213
214+ #if _MSC_VER >= 1300
210215static PyObject *
211216msvcrt_putwch (PyObject * self , PyObject * args )
212217{
@@ -225,6 +230,7 @@ msvcrt_putwch(PyObject *self, PyObject *args)
225230 Py_RETURN_NONE ;
226231
227232}
233+ #endif
228234
229235static PyObject *
230236msvcrt_ungetch (PyObject * self , PyObject * args )
@@ -240,6 +246,7 @@ msvcrt_ungetch(PyObject *self, PyObject *args)
240246 return Py_None ;
241247}
242248
249+ #if _MSC_VER >= 1300
243250static PyObject *
244251msvcrt_ungetwch (PyObject * self , PyObject * args )
245252{
@@ -253,6 +260,7 @@ msvcrt_ungetwch(PyObject *self, PyObject *args)
253260 Py_INCREF (Py_None );
254261 return Py_None ;
255262}
263+ #endif
256264
257265static void
258266insertint (PyObject * d , char * name , int value )
@@ -341,10 +349,12 @@ static struct PyMethodDef msvcrt_functions[] = {
341349 {"CrtSetReportMode" , msvcrt_setreportmode , METH_VARARGS },
342350 {"set_error_mode" , msvcrt_seterrormode , METH_VARARGS },
343351#endif
352+ #if _MSC_VER >= 1300
344353 {"getwch" , msvcrt_getwch , METH_VARARGS },
345354 {"getwche" , msvcrt_getwche , METH_VARARGS },
346355 {"putwch" , msvcrt_putwch , METH_VARARGS },
347356 {"ungetwch" , msvcrt_ungetwch , METH_VARARGS },
357+ #endif
348358 {NULL , NULL }
349359};
350360
0 commit comments