@@ -1506,7 +1506,7 @@ PyUnicode_Decode(const char *s,
15061506 (strcmp (lower , "latin1" ) == 0 ) ||
15071507 (strcmp (lower , "iso-8859-1" ) == 0 ))
15081508 return PyUnicode_DecodeLatin1 (s , size , errors );
1509- #if defined( MS_WINDOWS ) && defined( HAVE_USABLE_WCHAR_T )
1509+ #ifdef HAVE_MBCS
15101510 else if (strcmp (lower , "mbcs ") == 0 )
15111511 return PyUnicode_DecodeMBCS (s , size , errors );
15121512#endif
@@ -1644,7 +1644,7 @@ PyUnicode_AsEncodedObject(PyObject *unicode,
16441644PyObject *
16451645PyUnicode_EncodeFSDefault (PyObject * unicode )
16461646{
1647- #if defined( MS_WINDOWS ) && defined( HAVE_USABLE_WCHAR_T )
1647+ #ifdef HAVE_MBCS
16481648 return PyUnicode_EncodeMBCS (PyUnicode_AS_UNICODE (unicode ),
16491649 PyUnicode_GET_SIZE (unicode ),
16501650 NULL );
@@ -1746,7 +1746,7 @@ PyUnicode_AsEncodedString(PyObject *unicode,
17461746 return PyUnicode_EncodeLatin1 (PyUnicode_AS_UNICODE (unicode ),
17471747 PyUnicode_GET_SIZE (unicode ),
17481748 errors );
1749- #if defined( MS_WINDOWS ) && defined( HAVE_USABLE_WCHAR_T )
1749+ #ifdef HAVE_MBCS
17501750 else if (strcmp (lower , "mbcs ") == 0 )
17511751 return PyUnicode_EncodeMBCS (PyUnicode_AS_UNICODE (unicode ),
17521752 PyUnicode_GET_SIZE (unicode ),
@@ -1848,7 +1848,7 @@ PyUnicode_DecodeFSDefault(const char *s) {
18481848PyObject *
18491849PyUnicode_DecodeFSDefaultAndSize (const char * s , Py_ssize_t size )
18501850{
1851- #if defined( MS_WINDOWS ) && defined( HAVE_USABLE_WCHAR_T )
1851+ #ifdef HAVE_MBCS
18521852 return PyUnicode_DecodeMBCS (s , size , NULL );
18531853#elif defined(__APPLE__ )
18541854 return PyUnicode_DecodeUTF8 (s , size , "surrogateescape" );
@@ -4942,7 +4942,7 @@ PyUnicode_AsASCIIString(PyObject *unicode)
49424942 NULL );
49434943}
49444944
4945- #if defined( MS_WINDOWS ) && defined( HAVE_USABLE_WCHAR_T )
4945+ #ifdef HAVE_MBCS
49464946
49474947/* --- MBCS codecs for Windows -------------------------------------------- */
49484948
@@ -5229,7 +5229,7 @@ PyUnicode_AsMBCSString(PyObject *unicode)
52295229
52305230#undef NEED_RETRY
52315231
5232- #endif /* MS_WINDOWS */
5232+ #endif /* HAVE_MBCS */
52335233
52345234/* --- Character Mapping Codec -------------------------------------------- */
52355235
0 commit comments