gh-106320: Move _PyUnicodeWriter to the internal C API (#106342)

Move also _PyUnicode_FormatAdvancedWriter().

CJK codecs and multibytecodec.c now define the Py_BUILD_CORE_MODULE
macro.
This commit is contained in:
Victor Stinner 2023-07-03 10:23:43 +02:00 committed by GitHub
parent d65b783b69
commit 5ccbbe5bb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 166 additions and 144 deletions

View file

@ -3,6 +3,14 @@ import re
from . import common as _common
# Modules/socketmodule.h uses pycore_time.h which needs the Py_BUILD_CORE
# macro. Usually it's defined by the C file which includes it.
# Other header files have a similar issue.
NEED_BUILD_CORE = {
'cjkcodecs.h',
'multibytecodec.h',
'socketmodule.h',
}
TOOL = 'gcc'
@ -62,9 +70,7 @@ def preprocess(filename,
filename = _normpath(filename, cwd)
postargs = POST_ARGS
if os.path.basename(filename) == 'socketmodule.h':
# Modules/socketmodule.h uses pycore_time.h which needs Py_BUILD_CORE.
# Usually it's defined by the C file which includes it.
if os.path.basename(filename) in NEED_BUILD_CORE:
postargs += ('-DPy_BUILD_CORE=1',)
text = _common.preprocess(