From 46d77610fc77088bceac720a13d9f2df3a50f29e Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 2 Jul 2023 00:27:18 +0200 Subject: gh-106316: Remove pytime.h header file (#106317) Remove the "cpython/pytime.h" header file: it only contained private functions. Move functions to the internal pycore_time.h header file. Move tests from _testcapi to _testinternalcapi. Rename also test methods to have the same name than tested C functions. No longer export these functions: * _PyTime_Add() * _PyTime_As100Nanoseconds() * _PyTime_FromMicrosecondsClamp() * _PyTime_FromTimespec() * _PyTime_FromTimeval() * _PyTime_GetPerfCounterWithInfo() * _PyTime_MulDiv() --- Tools/c-analyzer/c_parser/preprocessor/gcc.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Tools/c-analyzer/c_parser/preprocessor/gcc.py') diff --git a/Tools/c-analyzer/c_parser/preprocessor/gcc.py b/Tools/c-analyzer/c_parser/preprocessor/gcc.py index 147615707a3..0929f7111ea 100644 --- a/Tools/c-analyzer/c_parser/preprocessor/gcc.py +++ b/Tools/c-analyzer/c_parser/preprocessor/gcc.py @@ -60,6 +60,13 @@ def preprocess(filename, if not cwd or not os.path.isabs(cwd): cwd = os.path.abspath(cwd or '.') 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. + postargs += ('-DPy_BUILD_CORE=1',) + text = _common.preprocess( TOOL, filename, @@ -67,7 +74,7 @@ def preprocess(filename, includes=includes, macros=macros, #preargs=PRE_ARGS, - postargs=POST_ARGS, + postargs=postargs, executable=['gcc'], compiler='unix', cwd=cwd, -- cgit v1.2.3