File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Tools/c-analyzer/c_parser/preprocessor Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 3
3
4
4
from . import common as _common
5
5
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 ((
9
8
# Modules/
10
9
'_testcapimodule.c' ,
11
10
'_testclinic_limited.c' ,
12
11
'xxlimited.c' ,
13
12
'xxlimited_35.c' ,
13
+ ))
14
14
15
+ # C files in the fhe following directories must not be built with
16
+ # Py_BUILD_CORE.
17
+ DIRS_WITHOUT_INTERNAL_CAPI = frozenset ((
15
18
# Modules/_testcapi/
16
- 'heaptype_relative.c' ,
17
- 'vectorcall_limited.c' ,
19
+ '_testcapi' ,
18
20
))
19
21
20
22
TOOL = 'gcc'
@@ -75,7 +77,10 @@ def preprocess(filename,
75
77
filename = _normpath (filename , cwd )
76
78
77
79
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 ):
79
84
postargs += ('-DPy_BUILD_CORE=1' ,)
80
85
81
86
text = _common .preprocess (
You can’t perform that action at this time.
0 commit comments