summaryrefslogtreecommitdiffstats
path: root/Include/cpython
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-04-07 00:29:52 (GMT)
committerGitHub <noreply@github.com>2022-04-07 00:29:52 (GMT)
commit85addfb9c6496eb3d26082348cf5aca848c877ef (patch)
treeb6a0cd3eda126249ee74b718cc7b2c2a3f4d5876 /Include/cpython
parent5c4d1f6e0e192653560ae2941a6677fbf4fbd1f2 (diff)
downloadcpython-85addfb9c6496eb3d26082348cf5aca848c877ef.zip
cpython-85addfb9c6496eb3d26082348cf5aca848c877ef.tar.gz
cpython-85addfb9c6496eb3d26082348cf5aca848c877ef.tar.bz2
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 <Python.h> header file. Python.h includes directly Include/cpython/code.h instead.
Diffstat (limited to 'Include/cpython')
-rw-r--r--Include/cpython/code.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/Include/cpython/code.h b/Include/cpython/code.h
index 1576783..6dc2290 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