#include "Python.h"
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
typedef struct {
// List of bytes objects
PyObject *list;
#ifdef __cplusplus
}
#endif
-#endif /* Py_INTERNAL_BLOCKS_OUTPUT_BUFFER_H */
\ No newline at end of file
+#endif /* Py_INTERNAL_BLOCKS_OUTPUT_BUFFER_H */
extern "C" {
#endif
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
#define CODE_MAX_WATCHERS 8
/* PEP 659
extern "C" {
#endif
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
extern PyObject* _PyCodec_Lookup(const char *encoding);
/* Text codec specific encoding and decoding API.
#if defined(__EMSCRIPTEN__)
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
void
_Py_CheckEmscriptenSignals(void);
#endif
#ifndef Py_BUILD_CORE
-# error "Py_BUILD_CORE must be defined to include this header"
+# error "this header requires Py_BUILD_CORE define"
#endif
#include <locale.h> /* struct lconv */
#endif
#ifndef Py_BUILD_CORE
-# error "Py_BUILD_CORE must be defined to include this header"
+# error "this header requires Py_BUILD_CORE define"
#endif
#ifdef MS_WINDOWS
extern "C" {
#endif
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
#include <stdbool.h>
#include <stddef.h> // offsetof()
#include "pycore_code.h" // STATS
extern "C" {
#endif
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
#include "pycore_hashtable.h" // _Py_hashtable_t
#include "pycore_time.h" // _PyTime_t
-
#ifndef Py_INTERNAL_INSTRUMENT_H
#define Py_INTERNAL_INSTRUMENT_H
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
#include "pycore_bitutils.h" // _Py_popcount32
#include "pycore_frame.h"
+#ifndef Py_INTERNAL_INTRINSIC_H
+#define Py_INTERNAL_INTRINSIC_H
+
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
/* Unary Functions: */
#define INTRINSIC_1_INVALID 0
extern const intrinsic_func1_info _PyIntrinsics_UnaryFunctions[];
extern const intrinsic_func2_info _PyIntrinsics_BinaryFunctions[];
+
+#endif // !Py_INTERNAL_INTRINSIC_H
// Python/bytecodes.c
// Do not edit!
+#ifndef Py_BUILD_CORE
+# error "this header requires Py_BUILD_CORE define"
+#endif
+
#include <stdbool.h>
/* _bz2 - Low-level Python interface to libbzip2. */
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#include <bzlib.h>
*/
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#include "compile.h"
#include "opcode.h"
/* Windows users: read Python's PCbuild\readme.txt */
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#include "zlib.h"
import os
import posixpath
import sys
+import textwrap
import typing
from collections.abc import Iterator
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()