mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Move _PyUnicode_UTF8() and _PyUnicode_UTF8_LENGTH() outside unicodeobject.h
Move these macros to unicodeobject.c
This commit is contained in:
parent
a0702ab1fe
commit
bc8b81bc4e
2 changed files with 8 additions and 10 deletions
|
@ -377,16 +377,6 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
|
|||
PyUnicode_IS_COMPACT(op) ? _PyUnicode_COMPACT_DATA(op) : \
|
||||
_PyUnicode_NONCOMPACT_DATA(op))
|
||||
|
||||
#define _PyUnicode_UTF8(op) \
|
||||
(PyUnicode_IS_COMPACT_ASCII(op) ? \
|
||||
((char*)((PyASCIIObject*)(op) + 1)) : \
|
||||
((PyCompactUnicodeObject*)(op))->utf8)
|
||||
|
||||
#define _PyUnicode_UTF8_LENGTH(op) \
|
||||
(PyUnicode_IS_COMPACT_ASCII(op) ? \
|
||||
((PyASCIIObject*)(op))->length : \
|
||||
((PyCompactUnicodeObject*)(op))->utf8_length)
|
||||
|
||||
/* Compute (index * char_size) where char_size is 2 ** (kind - 1).
|
||||
|
||||
The index is a character index, the result is a size in bytes. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue