mirror of
https://github.com/python/cpython.git
synced 2025-09-23 08:53:45 +00:00
gh-108220: Internal header files require Py_BUILD_CORE to be defined (#108221)
* pycore_intrinsics.h does nothing if included twice (add #ifndef and #define). * Update Tools/cases_generator/generate_cases.py to generate the Py_BUILD_CORE test. * _bz2, _lzma, _opcode and zlib extensions now define the Py_BUILD_CORE_MODULE macro to use internal headers (pycore_code.h, pycore_intrinsics.h and pycore_blocks_output_buffer.h).
This commit is contained in:
parent
db55383829
commit
21c0844742
16 changed files with 65 additions and 4 deletions
|
@ -9,6 +9,7 @@ import itertools
|
|||
import os
|
||||
import posixpath
|
||||
import sys
|
||||
import textwrap
|
||||
import typing
|
||||
from collections.abc import Iterator
|
||||
|
||||
|
@ -403,6 +404,12 @@ class Generator(Analyzer):
|
|||
|
||||
self.write_provenance_header()
|
||||
|
||||
self.out.emit("\n" + textwrap.dedent("""
|
||||
#ifndef Py_BUILD_CORE
|
||||
# error "this header requires Py_BUILD_CORE define"
|
||||
#endif
|
||||
""").strip())
|
||||
|
||||
self.out.emit("\n#include <stdbool.h>")
|
||||
|
||||
self.write_pseudo_instrs()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue