diff options
-rw-r--r-- | Include/pyport.h | 4 | ||||
-rw-r--r-- | Tools/c-analyzer/c_parser/preprocessor/gcc.py | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/Include/pyport.h b/Include/pyport.h index 4b6858b..40d580a 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -48,6 +48,10 @@ # 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 diff --git a/Tools/c-analyzer/c_parser/preprocessor/gcc.py b/Tools/c-analyzer/c_parser/preprocessor/gcc.py index 18d1b1a..d206ceb 100644 --- a/Tools/c-analyzer/c_parser/preprocessor/gcc.py +++ b/Tools/c-analyzer/c_parser/preprocessor/gcc.py @@ -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' |