Skip to content

Commit ee89db4

Browse files
committed
Fix make check-c-globals
1 parent 225f076 commit ee89db4

File tree

1 file changed

+11
-6
lines changed
  • Tools/c-analyzer/c_parser/preprocessor

1 file changed

+11
-6
lines changed

Tools/c-analyzer/c_parser/preprocessor/gcc.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33

44
from . import common as _common
55

6-
# The following C files define the Py_LIMITED_API macro, and so must not be
7-
# built with the Py_BUILD_CORE macro defined.
8-
USE_LIMITED_C_API = frozenset((
6+
# The following C files must not built with Py_BUILD_CORE.
7+
FILES_WITHOUT_INTERNAL_CAPI = frozenset((
98
# Modules/
109
'_testcapimodule.c',
1110
'_testclinic_limited.c',
1211
'xxlimited.c',
1312
'xxlimited_35.c',
13+
))
1414

15+
# C files in the fhe following directories must not be built with
16+
# Py_BUILD_CORE.
17+
DIRS_WITHOUT_INTERNAL_CAPI = frozenset((
1518
# Modules/_testcapi/
16-
'heaptype_relative.c',
17-
'vectorcall_limited.c',
19+
'_testcapi',
1820
))
1921

2022
TOOL = 'gcc'
@@ -75,7 +77,10 @@ def preprocess(filename,
7577
filename = _normpath(filename, cwd)
7678

7779
postargs = POST_ARGS
78-
if os.path.basename(filename) not in USE_LIMITED_C_API:
80+
basename = os.path.basename(filename)
81+
dirname = os.path.basename(os.path.dirname(filename))
82+
if (basename not in FILES_WITHOUT_INTERNAL_CAPI
83+
and dirname not in DIRS_WITHOUT_INTERNAL_CAPI):
7984
postargs += ('-DPy_BUILD_CORE=1',)
8085

8186
text = _common.preprocess(

0 commit comments

Comments
 (0)