]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-104469: Disallow using Py_LIMITED_API with Py_BUILD_CORE (#109690)
authorVictor Stinner <vstinner@python.org>
Thu, 21 Sep 2023 23:21:07 +0000 (01:21 +0200)
committerGitHub <noreply@github.com>
Thu, 21 Sep 2023 23:21:07 +0000 (01:21 +0200)
Fix make check-c-globals: complete USE_LIMITED_C_API list of the
c-analyzer.

Include/pyport.h
Tools/c-analyzer/c_parser/preprocessor/gcc.py

index 4b6858bf527df187002f5ccbf167c9c26644d2d6..40d580a870fc75b6b6aae7d26ef1708ba3265c2e 100644 (file)
 #  define Py_BUILD_CORE
 #endif
 
+#if defined(Py_LIMITED_API) && defined(Py_BUILD_CORE)
+#  error "Py_LIMITED_API is not compatible with Py_BUILD_CORE"
+#endif
+
 
 /**************************************************************************
 Symbols and macros to supply platform-independent interfaces to basic
index 18d1b1a5d0a37f4e1c6a5ccf8971cc527949133c..d206ceb43a268edd0d7e29db3573ff562d060296 100644 (file)
@@ -3,13 +3,18 @@ import re
 
 from . import common as _common
 
-# The following C files must not be built with Py_BUILD_CORE,
-# because they use the limited C API.
+# The following C files define the Py_LIMITED_API macro, and so must not be
+# built with the Py_BUILD_CORE macro defined.
 USE_LIMITED_C_API = frozenset((
+    # Modules/
     '_testcapimodule.c',
     '_testclinic_limited.c',
     'xxlimited.c',
     'xxlimited_35.c',
+
+    # Modules/_testcapi/
+    'heaptype_relative.c',
+    'vectorcall_limited.c',
 ))
 
 TOOL = 'gcc'