mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
GH-96458: Statically initialize utf8 representation of static strings (#96481)
This commit is contained in:
parent
16c6759b37
commit
6dab8c95bd
6 changed files with 139 additions and 165 deletions
|
@ -113,10 +113,12 @@ extern "C" {
|
|||
._ ## NAME = _PyASCIIObject_INIT(LITERAL)
|
||||
#define INIT_ID(NAME) \
|
||||
._ ## NAME = _PyASCIIObject_INIT(#NAME)
|
||||
#define _PyUnicode_LATIN1_INIT(LITERAL) \
|
||||
#define _PyUnicode_LATIN1_INIT(LITERAL, UTF8) \
|
||||
{ \
|
||||
._latin1 = { \
|
||||
._base = _PyUnicode_ASCII_BASE_INIT((LITERAL), 0), \
|
||||
.utf8 = (UTF8), \
|
||||
.utf8_length = sizeof(UTF8) - 1, \
|
||||
}, \
|
||||
._data = (LITERAL), \
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue