summaryrefslogtreecommitdiff
path: root/PC/msvcrtmodule.c
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-06-13 00:42:22 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-06-13 00:42:22 +0000
commite000b21702037201b0ed91b4593ec81da6e7b1a6 (patch)
tree82cb9fd11e31e5d435ba590b521540414dcab336 /PC/msvcrtmodule.c
parente3d5374b2800a568d45f03c88a786a875db54bed (diff)
downloadcpython-e000b21702037201b0ed91b4593ec81da6e7b1a6.tar.gz
Restore support for Microsoft VC6 compiler.
Some functions in the msvcrt module are skipped, and socket.ioctl is enabled only when using a more recent Platform SDK. (and yes, there are still companies that use a 10-years old compiler)
Diffstat (limited to 'PC/msvcrtmodule.c')
-rwxr-xr-xPC/msvcrtmodule.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/PC/msvcrtmodule.c b/PC/msvcrtmodule.c
index e110ed8b09..95e369b424 100755
--- a/PC/msvcrtmodule.c
+++ b/PC/msvcrtmodule.c
@@ -143,6 +143,7 @@ msvcrt_getch(PyObject *self, PyObject *args)
return PyString_FromStringAndSize(s, 1);
}
+#ifdef _WCONIO_DEFINED
static PyObject *
msvcrt_getwch(PyObject *self, PyObject *args)
{
@@ -158,6 +159,7 @@ msvcrt_getwch(PyObject *self, PyObject *args)
u[0] = ch;
return PyUnicode_FromUnicode(u, 1);
}
+#endif
static PyObject *
msvcrt_getche(PyObject *self, PyObject *args)
@@ -175,6 +177,7 @@ msvcrt_getche(PyObject *self, PyObject *args)
return PyString_FromStringAndSize(s, 1);
}
+#ifdef _WCONIO_DEFINED
static PyObject *
msvcrt_getwche(PyObject *self, PyObject *args)
{
@@ -190,6 +193,7 @@ msvcrt_getwche(PyObject *self, PyObject *args)
s[0] = ch;
return PyUnicode_FromUnicode(s, 1);
}
+#endif
static PyObject *
msvcrt_putch(PyObject *self, PyObject *args)
@@ -204,7 +208,7 @@ msvcrt_putch(PyObject *self, PyObject *args)
return Py_None;
}
-
+#ifdef _WCONIO_DEFINED
static PyObject *
msvcrt_putwch(PyObject *self, PyObject *args)
{
@@ -223,6 +227,7 @@ msvcrt_putwch(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
+#endif
static PyObject *
msvcrt_ungetch(PyObject *self, PyObject *args)
@@ -238,6 +243,7 @@ msvcrt_ungetch(PyObject *self, PyObject *args)
return Py_None;
}
+#ifdef _WCONIO_DEFINED
static PyObject *
msvcrt_ungetwch(PyObject *self, PyObject *args)
{
@@ -251,6 +257,7 @@ msvcrt_ungetwch(PyObject *self, PyObject *args)
Py_INCREF(Py_None);
return Py_None;
}
+#endif
static void
insertint(PyObject *d, char *name, int value)
@@ -279,11 +286,12 @@ static struct PyMethodDef msvcrt_functions[] = {
{"getche", msvcrt_getche, METH_VARARGS},
{"putch", msvcrt_putch, METH_VARARGS},
{"ungetch", msvcrt_ungetch, METH_VARARGS},
+#ifdef _WCONIO_DEFINED
{"getwch", msvcrt_getwch, METH_VARARGS},
{"getwche", msvcrt_getwche, METH_VARARGS},
{"putwch", msvcrt_putwch, METH_VARARGS},
{"ungetwch", msvcrt_ungetwch, METH_VARARGS},
-
+#endif
{NULL, NULL}
};