Issue #9642: Uniformize the tests on the availability of the mbcs codec
Add a new HAVE_MBCS define.
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c
index eb740f9..4bc0482 100644
--- a/Modules/_codecsmodule.c
+++ b/Modules/_codecsmodule.c
@@ -588,7 +588,7 @@
return codec_tuple(unicode, pbuf.len);
}
-#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
+#ifdef HAVE_MBCS
static PyObject *
mbcs_decode(PyObject *self,
@@ -613,7 +613,7 @@
return codec_tuple(decoded, consumed);
}
-#endif /* MS_WINDOWS */
+#endif /* HAVE_MBCS */
/* --- Encoder ------------------------------------------------------------ */
@@ -989,7 +989,7 @@
return PyUnicode_BuildEncodingMap(map);
}
-#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
+#ifdef HAVE_MBCS
static PyObject *
mbcs_encode(PyObject *self,
@@ -1014,7 +1014,7 @@
return v;
}
-#endif /* MS_WINDOWS */
+#endif /* HAVE_MBCS */
/* --- Error handler registry --------------------------------------------- */
@@ -1101,7 +1101,7 @@
{"charmap_decode", charmap_decode, METH_VARARGS},
{"charmap_build", charmap_build, METH_VARARGS},
{"readbuffer_encode", readbuffer_encode, METH_VARARGS},
-#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
+#ifdef HAVE_MBCS
{"mbcs_encode", mbcs_encode, METH_VARARGS},
{"mbcs_decode", mbcs_decode, METH_VARARGS},
#endif