experimental UCS-4 support: don't assume that MS_WIN32 implies
HAVE_USABLE_WCHAR_T
This commit is contained in:
parent
ba18673045
commit
3083163dc1
|
@ -299,7 +299,7 @@ charmap_decode(PyObject *self,
|
||||||
size);
|
size);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MS_WIN32
|
#if defined(MS_WIN32) && defined(HAVE_USABLE_WCHAR_T)
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
mbcs_decode(PyObject *self,
|
mbcs_decode(PyObject *self,
|
||||||
|
@ -595,7 +595,7 @@ charmap_encode(PyObject *self,
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MS_WIN32
|
#if defined(MS_WIN32) && defined(HAVE_USABLE_WCHAR_T)
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
mbcs_encode(PyObject *self,
|
mbcs_encode(PyObject *self,
|
||||||
|
@ -650,7 +650,7 @@ static PyMethodDef _codecs_functions[] = {
|
||||||
{"charmap_decode", charmap_decode, 1},
|
{"charmap_decode", charmap_decode, 1},
|
||||||
{"readbuffer_encode", readbuffer_encode, 1},
|
{"readbuffer_encode", readbuffer_encode, 1},
|
||||||
{"charbuffer_encode", charbuffer_encode, 1},
|
{"charbuffer_encode", charbuffer_encode, 1},
|
||||||
#ifdef MS_WIN32
|
#if defined(MS_WIN32) && defined(HAVE_USABLE_WCHAR_T)
|
||||||
{"mbcs_encode", mbcs_encode, 1},
|
{"mbcs_encode", mbcs_encode, 1},
|
||||||
{"mbcs_decode", mbcs_decode, 1},
|
{"mbcs_decode", mbcs_decode, 1},
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1379,7 +1379,7 @@ PyObject *unicodeescape_string(const Py_UNICODE *s,
|
||||||
while (size-- > 0) {
|
while (size-- > 0) {
|
||||||
Py_UNICODE ch = *s++;
|
Py_UNICODE ch = *s++;
|
||||||
/* Escape quotes */
|
/* Escape quotes */
|
||||||
if (quotes && (ch == q[1] || ch == '\\')) {
|
if (quotes && (ch == (Py_UNICODE) q[1] || ch == '\\')) {
|
||||||
*p++ = '\\';
|
*p++ = '\\';
|
||||||
*p++ = (char) ch;
|
*p++ = (char) ch;
|
||||||
}
|
}
|
||||||
|
@ -1831,7 +1831,7 @@ PyObject *PyUnicode_AsASCIIString(PyObject *unicode)
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MS_WIN32
|
#if defined(MS_WIN32) && defined(HAVE_USABLE_WCHAR_T)
|
||||||
|
|
||||||
/* --- MBCS codecs for Windows -------------------------------------------- */
|
/* --- MBCS codecs for Windows -------------------------------------------- */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue