Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bpo-39026: Rename Include/cpython/ header files #28612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Include/Python.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
#include "typeslots.h"
#include "pyhash.h"

#include "cpython/pydebug.h"
#include "cpython/cpython_pydebug.h"

#include "bytearrayobject.h"
#include "bytesobject.h"
Expand All @@ -91,7 +91,7 @@
#include "tupleobject.h"
#include "listobject.h"
#include "dictobject.h"
#include "cpython/odictobject.h"
#include "cpython/cpython_odictobject.h"
#include "enumobject.h"
#include "setobject.h"
#include "methodobject.h"
Expand All @@ -113,13 +113,13 @@
#include "weakrefobject.h"
#include "structseq.h"
#include "namespaceobject.h"
#include "cpython/picklebufobject.h"
#include "cpython/pytime.h"
#include "cpython/cpython_picklebufobject.h"
#include "cpython/cpython_pytime.h"

#include "codecs.h"
#include "pyerrors.h"

#include "cpython/initconfig.h"
#include "cpython/cpython_initconfig.h"
#include "pythread.h"
#include "pystate.h"
#include "context.h"
Expand All @@ -139,11 +139,11 @@

#include "eval.h"

#include "cpython/pyctype.h"
#include "cpython/cpython_pyctype.h"
#include "pystrtod.h"
#include "pystrcmp.h"
#include "fileutils.h"
#include "cpython/pyfpe.h"
#include "cpython/cpython_pyfpe.h"
#include "tracemalloc.h"

#endif /* !Py_PYTHON_H */
2 changes: 1 addition & 1 deletion Include/abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ PyAPI_FUNC(int) PyObject_IsSubclass(PyObject *object, PyObject *typeorclass);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_ABSTRACTOBJECT_H
# include "cpython/abstract.h"
# include "cpython/cpython_abstract.h"
# undef Py_CPYTHON_ABSTRACTOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/bytearrayobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_BYTEARRAYOBJECT_H
# include "cpython/bytearrayobject.h"
# include "cpython/cpython_bytearrayobject.h"
# undef Py_CPYTHON_BYTEARRAYOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/bytesobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ PyAPI_FUNC(int) PyBytes_AsStringAndSize(

#ifndef Py_LIMITED_API
# define Py_CPYTHON_BYTESOBJECT_H
# include "cpython/bytesobject.h"
# include "cpython/cpython_bytesobject.h"
# undef Py_CPYTHON_BYTESOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/ceval.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ PyAPI_FUNC(void) PyEval_ReleaseThread(PyThreadState *tstate);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_CEVAL_H
# include "cpython/ceval.h"
# include "cpython/cpython_ceval.h"
# undef Py_CPYTHON_CEVAL_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/code.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ typedef struct PyCodeObject PyCodeObject;

#ifndef Py_LIMITED_API
# define Py_CPYTHON_CODE_H
# include "cpython/code.h"
# include "cpython/cpython_code.h"
# undef Py_CPYTHON_CODE_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/compile.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern "C" {

#ifndef Py_LIMITED_API
# define Py_CPYTHON_COMPILE_H
# include "cpython/compile.h"
# include "cpython/cpython_compile.h"
# undef Py_CPYTHON_COMPILE_H
#endif

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# error "this header file must not be included directly"
#endif

#include "cpython/initconfig.h"
#include "cpython_initconfig.h"

PyAPI_FUNC(int) _PyInterpreterState_RequiresIDRef(PyInterpreterState *);
PyAPI_FUNC(void) _PyInterpreterState_RequireIDRef(PyInterpreterState *, int);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Include/dictobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ PyAPI_DATA(PyTypeObject) PyDictRevIterValue_Type;

#ifndef Py_LIMITED_API
# define Py_CPYTHON_DICTOBJECT_H
# include "cpython/dictobject.h"
# include "cpython/cpython_dictobject.h"
# undef Py_CPYTHON_DICTOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/fileobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PyAPI_DATA(int) Py_UTF8Mode;

#ifndef Py_LIMITED_API
# define Py_CPYTHON_FILEOBJECT_H
# include "cpython/fileobject.h"
# include "cpython/cpython_fileobject.h"
# undef Py_CPYTHON_FILEOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/fileutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PyAPI_FUNC(char*) Py_EncodeLocale(

#ifndef Py_LIMITED_API
# define Py_CPYTHON_FILEUTILS_H
# include "cpython/fileutils.h"
# include "cpython/cpython_fileutils.h"
# undef Py_CPYTHON_FILEUTILS_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/frameobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extern "C" {

#ifndef Py_LIMITED_API
# define Py_CPYTHON_FRAMEOBJECT_H
# include "cpython/frameobject.h"
# include "cpython/cpython_frameobject.h"
# undef Py_CPYTHON_FRAMEOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/import.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ PyAPI_FUNC(int) PyImport_AppendInittab(

#ifndef Py_LIMITED_API
# define Py_CPYTHON_IMPORT_H
# include "cpython/import.h"
# include "cpython/cpython_import.h"
# undef Py_CPYTHON_IMPORT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/interpreteridobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ extern "C" {

#ifndef Py_LIMITED_API
# define Py_CPYTHON_INTERPRETERIDOBJECT_H
# include "cpython/interpreteridobject.h"
# include "cpython/cpython_interpreteridobject.h"
# undef Py_CPYTHON_INTERPRETERIDOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/listobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_LISTOBJECT_H
# include "cpython/listobject.h"
# include "cpython/cpython_listobject.h"
# undef Py_CPYTHON_LISTOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/methodobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ PyAPI_FUNC(PyObject *) PyCMethod_New(PyMethodDef *, PyObject *,
#ifndef Py_LIMITED_API

#define Py_CPYTHON_METHODOBJECT_H
#include "cpython/methodobject.h"
#include "cpython/cpython_methodobject.h"
#undef Py_CPYTHON_METHODOBJECT_H

#endif
Expand Down
2 changes: 1 addition & 1 deletion Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ times.

#ifndef Py_LIMITED_API
# define Py_CPYTHON_OBJECT_H
# include "cpython/object.h"
# include "cpython/cpython_object.h"
# undef Py_CPYTHON_OBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/objimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ PyAPI_FUNC(int) PyObject_GC_IsFinalized(PyObject *);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_OBJIMPL_H
# include "cpython/objimpl.h"
# include "cpython/cpython_objimpl.h"
# undef Py_CPYTHON_OBJIMPL_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/pyerrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ PyAPI_FUNC(int) PyOS_vsnprintf(char *str, size_t size, const char *format, va_l

#ifndef Py_LIMITED_API
# define Py_CPYTHON_ERRORS_H
# include "cpython/pyerrors.h"
# include "cpython/cpython_pyerrors.h"
# undef Py_CPYTHON_ERRORS_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/pylifecycle.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ PyAPI_FUNC(PyOS_sighandler_t) PyOS_setsig(int, PyOS_sighandler_t);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_PYLIFECYCLE_H
# include "cpython/pylifecycle.h"
# include "cpython/cpython_pylifecycle.h"
# undef Py_CPYTHON_PYLIFECYCLE_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/pymem.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ PyAPI_FUNC(void) PyMem_Free(void *ptr);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_PYMEM_H
# include "cpython/pymem.h"
# include "cpython/cpython_pymem.h"
# undef Py_CPYTHON_PYMEM_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/pystate.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_PYSTATE_H
# include "cpython/pystate.h"
# include "cpython/cpython_pystate.h"
# undef Py_CPYTHON_PYSTATE_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/pythonrun.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ PyAPI_FUNC(int) PyOS_CheckStack(void);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_PYTHONRUN_H
# include "cpython/pythonrun.h"
# include "cpython/cpython_pythonrun.h"
# undef Py_CPYTHON_PYTHONRUN_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/sysmodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PyAPI_FUNC(PyObject *) PySys_GetXOptions(void);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_SYSMODULE_H
# include "cpython/sysmodule.h"
# include "cpython/cpython_sysmodule.h"
# undef Py_CPYTHON_SYSMODULE_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/traceback.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PyAPI_DATA(PyTypeObject) PyTraceBack_Type;

#ifndef Py_LIMITED_API
# define Py_CPYTHON_TRACEBACK_H
# include "cpython/traceback.h"
# include "cpython/cpython_traceback.h"
# undef Py_CPYTHON_TRACEBACK_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/tupleobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_TUPLEOBJECT_H
# include "cpython/tupleobject.h"
# include "cpython/cpython_tupleobject.h"
# undef Py_CPYTHON_TUPLEOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Include/unicodeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s);

#ifndef Py_LIMITED_API
# define Py_CPYTHON_UNICODEOBJECT_H
# include "cpython/unicodeobject.h"
# include "cpython/cpython_unicodeobject.h"
# undef Py_CPYTHON_UNICODEOBJECT_H
#endif

Expand Down
2 changes: 1 addition & 1 deletion Lib/__future__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
argument to the builtin function compile() to enable the feature in
dynamically compiled code. This flag is stored in the .compiler_flag
attribute on _Future instances. These values must match the appropriate
#defines of CO_xxx flags in Include/cpython/compile.h.
#defines of CO_xxx flags in Include/cpython/cpython_compile.h.

No feature line is ever to be deleted from this file.
"""
Expand Down
64 changes: 32 additions & 32 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -1175,38 +1175,38 @@ PYTHON_HEADERS= \
pyconfig.h \
$(PARSER_HEADERS) \
\
$(srcdir)/Include/cpython/abstract.h \
$(srcdir)/Include/cpython/bytearrayobject.h \
$(srcdir)/Include/cpython/bytesobject.h \
$(srcdir)/Include/cpython/ceval.h \
$(srcdir)/Include/cpython/code.h \
$(srcdir)/Include/cpython/compile.h \
$(srcdir)/Include/cpython/dictobject.h \
$(srcdir)/Include/cpython/fileobject.h \
$(srcdir)/Include/cpython/fileutils.h \
$(srcdir)/Include/cpython/frameobject.h \
$(srcdir)/Include/cpython/import.h \
$(srcdir)/Include/cpython/initconfig.h \
$(srcdir)/Include/cpython/interpreteridobject.h \
$(srcdir)/Include/cpython/listobject.h \
$(srcdir)/Include/cpython/methodobject.h \
$(srcdir)/Include/cpython/object.h \
$(srcdir)/Include/cpython/objimpl.h \
$(srcdir)/Include/cpython/odictobject.h \
$(srcdir)/Include/cpython/picklebufobject.h \
$(srcdir)/Include/cpython/pyctype.h \
$(srcdir)/Include/cpython/pydebug.h \
$(srcdir)/Include/cpython/pyerrors.h \
$(srcdir)/Include/cpython/pyfpe.h \
$(srcdir)/Include/cpython/pylifecycle.h \
$(srcdir)/Include/cpython/pymem.h \
$(srcdir)/Include/cpython/pystate.h \
$(srcdir)/Include/cpython/pythonrun.h \
$(srcdir)/Include/cpython/pytime.h \
$(srcdir)/Include/cpython/sysmodule.h \
$(srcdir)/Include/cpython/traceback.h \
$(srcdir)/Include/cpython/tupleobject.h \
$(srcdir)/Include/cpython/unicodeobject.h \
$(srcdir)/Include/cpython/cpython_abstract.h \
$(srcdir)/Include/cpython/cpython_bytearrayobject.h \
$(srcdir)/Include/cpython/cpython_bytesobject.h \
$(srcdir)/Include/cpython/cpython_ceval.h \
$(srcdir)/Include/cpython/cpython_code.h \
$(srcdir)/Include/cpython/cpython_compile.h \
$(srcdir)/Include/cpython/cpython_dictobject.h \
$(srcdir)/Include/cpython/cpython_fileobject.h \
$(srcdir)/Include/cpython/cpython_fileutils.h \
$(srcdir)/Include/cpython/cpython_frameobject.h \
$(srcdir)/Include/cpython/cpython_import.h \
$(srcdir)/Include/cpython/cpython_initconfig.h \
$(srcdir)/Include/cpython/cpython_interpreteridobject.h \
$(srcdir)/Include/cpython/cpython_listobject.h \
$(srcdir)/Include/cpython/cpython_methodobject.h \
$(srcdir)/Include/cpython/cpython_object.h \
$(srcdir)/Include/cpython/cpython_objimpl.h \
$(srcdir)/Include/cpython/cpython_odictobject.h \
$(srcdir)/Include/cpython/cpython_picklebufobject.h \
$(srcdir)/Include/cpython/cpython_pyctype.h \
$(srcdir)/Include/cpython/cpython_pydebug.h \
$(srcdir)/Include/cpython/cpython_pyerrors.h \
$(srcdir)/Include/cpython/cpython_pyfpe.h \
$(srcdir)/Include/cpython/cpython_pylifecycle.h \
$(srcdir)/Include/cpython/cpython_pymem.h \
$(srcdir)/Include/cpython/cpython_pystate.h \
$(srcdir)/Include/cpython/cpython_pythonrun.h \
$(srcdir)/Include/cpython/cpython_pytime.h \
$(srcdir)/Include/cpython/cpython_sysmodule.h \
$(srcdir)/Include/cpython/cpython_traceback.h \
$(srcdir)/Include/cpython/cpython_tupleobject.h \
$(srcdir)/Include/cpython/cpython_unicodeobject.h \
\
$(srcdir)/Include/internal/pycore_abstract.h \
$(srcdir)/Include/internal/pycore_accu.h \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fix building Python on macOS Framework: fix include from
Include/cpython/pystate.h to Include/cpython/initconfig.h. Header files of
the Include/cpython/ subdirectory now get a ``cpython_`` prefix in their
filename to avoid confusion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Header files of the ``Include/cpython/`` subdirectory now get a ``cpython_``
prefix in their filename to avoid confusion between ``Include/<header>.h``
and ``Include/cpython/<header.h>`` (previously both files had the same
name), especially when a cpython header file includes another cpython header
file. Headers of the ``Include/cpython/`` subdirectory cannot be included
directly, so this change has no impact on the C API.
Loading