From 85addfb9c6496eb3d26082348cf5aca848c877ef Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 7 Apr 2022 02:29:52 +0200 Subject: bpo-35134: Remove the Include/code.h header file (GH-32385) Remove the Include/code.h header file. C extensions should only include the main header file. Python.h includes directly Include/cpython/code.h instead. --- Include/cpython/code.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'Include/cpython/code.h') diff --git a/Include/cpython/code.h b/Include/cpython/code.h index 1576783179..6dc2290ffe 100644 --- a/Include/cpython/code.h +++ b/Include/cpython/code.h @@ -1,5 +1,10 @@ -#ifndef Py_CPYTHON_CODE_H -# error "this header file must not be included directly" +/* Definitions for bytecode */ + +#ifndef Py_LIMITED_API +#ifndef Py_CODE_H +#define Py_CODE_H +#ifdef __cplusplus +extern "C" { #endif /* Each instruction in a code object is a fixed-width value, @@ -204,3 +209,9 @@ PyAPI_FUNC(int) _PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra); PyAPI_FUNC(int) _PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra); + +#ifdef __cplusplus +} +#endif +#endif // !Py_CODE_H +#endif // !Py_LIMITED_API -- cgit v1.2.1