mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
gh-105156: Deprecate the old Py_UNICODE type in C API (#105157)
Deprecate the old Py_UNICODE and PY_UNICODE_TYPE types in the C API: use wchar_t instead. Replace Py_UNICODE with wchar_t in multiple C files. Co-authored-by: Inada Naoki <songofacandy@gmail.com>
This commit is contained in:
parent
f332594dd4
commit
8ed705c083
9 changed files with 25 additions and 14 deletions
|
@ -1830,10 +1830,10 @@ typecode_to_mformat_code(char typecode)
|
|||
return UNSIGNED_INT8;
|
||||
|
||||
case 'u':
|
||||
if (sizeof(Py_UNICODE) == 2) {
|
||||
if (sizeof(wchar_t) == 2) {
|
||||
return UTF16_LE + is_big_endian;
|
||||
}
|
||||
if (sizeof(Py_UNICODE) == 4) {
|
||||
if (sizeof(wchar_t) == 4) {
|
||||
return UTF32_LE + is_big_endian;
|
||||
}
|
||||
return UNKNOWN_FORMAT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue