Skip to content

Commit 3f5c564

Browse files
authored
gh-104469: Disallow using Py_LIMITED_API with Py_BUILD_CORE (#109690)
Fix make check-c-globals: complete USE_LIMITED_C_API list of the c-analyzer.
1 parent 26e06ad commit 3f5c564

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Include/pyport.h

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
# define Py_BUILD_CORE
4949
#endif
5050

51+
#if defined(Py_LIMITED_API) && defined(Py_BUILD_CORE)
52+
# error "Py_LIMITED_API is not compatible with Py_BUILD_CORE"
53+
#endif
54+
5155

5256
/**************************************************************************
5357
Symbols and macros to supply platform-independent interfaces to basic

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

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,18 @@
33

44
from . import common as _common
55

6-
# The following C files must not be built with Py_BUILD_CORE,
7-
# because they use the limited C API.
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.
88
USE_LIMITED_C_API = frozenset((
9+
# Modules/
910
'_testcapimodule.c',
1011
'_testclinic_limited.c',
1112
'xxlimited.c',
1213
'xxlimited_35.c',
14+
15+
# Modules/_testcapi/
16+
'heaptype_relative.c',
17+
'vectorcall_limited.c',
1318
))
1419

1520
TOOL = 'gcc'

0 commit comments

Comments
 (0)