diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-04 12:23:54 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-07-04 12:23:54 (GMT) |
commit | 99b9538636e44f2400b45a4b9fa3d74ccb958922 (patch) | |
tree | e55a5c1779528ffdc849e153a9d479147c9aa800 /Objects | |
parent | 9122fdd8fae87190a47a94767b7f0157478306ef (diff) | |
download | cpython-99b9538636e44f2400b45a4b9fa3d74ccb958922.zip cpython-99b9538636e44f2400b45a4b9fa3d74ccb958922.tar.gz cpython-99b9538636e44f2400b45a4b9fa3d74ccb958922.tar.bz2 |
Issue #9642: Uniformize the tests on the availability of the mbcs codec
Add a new HAVE_MBCS define.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 7043599..9ecf89b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -1506,7 +1506,7 @@ PyUnicode_Decode(const char *s, (strcmp(lower, "latin1") == 0) || (strcmp(lower, "iso-8859-1") == 0)) return PyUnicode_DecodeLatin1(s, size, errors); -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#ifdef HAVE_MBCS else if (strcmp(lower, "mbcs") == 0) return PyUnicode_DecodeMBCS(s, size, errors); #endif @@ -1644,7 +1644,7 @@ PyUnicode_AsEncodedObject(PyObject *unicode, PyObject * PyUnicode_EncodeFSDefault(PyObject *unicode) { -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#ifdef HAVE_MBCS return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode), NULL); @@ -1746,7 +1746,7 @@ PyUnicode_AsEncodedString(PyObject *unicode, return PyUnicode_EncodeLatin1(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode), errors); -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#ifdef HAVE_MBCS else if (strcmp(lower, "mbcs") == 0) return PyUnicode_EncodeMBCS(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode), @@ -1848,7 +1848,7 @@ PyUnicode_DecodeFSDefault(const char *s) { PyObject* PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size) { -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#ifdef HAVE_MBCS return PyUnicode_DecodeMBCS(s, size, NULL); #elif defined(__APPLE__) return PyUnicode_DecodeUTF8(s, size, "surrogateescape"); @@ -4942,7 +4942,7 @@ PyUnicode_AsASCIIString(PyObject *unicode) NULL); } -#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) +#ifdef HAVE_MBCS /* --- MBCS codecs for Windows -------------------------------------------- */ @@ -5229,7 +5229,7 @@ PyUnicode_AsMBCSString(PyObject *unicode) #undef NEED_RETRY -#endif /* MS_WINDOWS */ +#endif /* HAVE_MBCS */ /* --- Character Mapping Codec -------------------------------------------- */ |