bpo-35081: Move interpreteridobject.h to Include/internal/ (GH-28969)

Move the interpreteridobject.h header file from Include/ to
Include/internal/. It only provides private functions.
This commit is contained in:
Victor Stinner 2021-10-15 11:56:34 +02:00 committed by GitHub
parent 59a633d3e2
commit 063abd931f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 26 additions and 35 deletions

View File

@ -1,11 +1,22 @@
#ifndef Py_CPYTHON_INTERPRETERIDOBJECT_H /* Interpreter ID Object */
# error "this header file must not be included directly"
#ifndef Py_INTERNAL_INTERPRETERIDOBJECT_H
#define Py_INTERNAL_INTERPRETERIDOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif #endif
/* Interpreter ID Object */ #ifndef Py_BUILD_CORE
# error "this header requires Py_BUILD_CORE define"
#endif
PyAPI_DATA(PyTypeObject) _PyInterpreterID_Type; PyAPI_DATA(PyTypeObject) _PyInterpreterID_Type;
PyAPI_FUNC(PyObject *) _PyInterpreterID_New(int64_t); PyAPI_FUNC(PyObject *) _PyInterpreterID_New(int64_t);
PyAPI_FUNC(PyObject *) _PyInterpreterState_GetIDObject(PyInterpreterState *); PyAPI_FUNC(PyObject *) _PyInterpreterState_GetIDObject(PyInterpreterState *);
PyAPI_FUNC(PyInterpreterState *) _PyInterpreterID_LookUp(PyObject *); PyAPI_FUNC(PyInterpreterState *) _PyInterpreterID_LookUp(PyObject *);
#ifdef __cplusplus
}
#endif
#endif // !Py_INTERNAL_INTERPRETERIDOBJECT_H

View File

@ -103,4 +103,4 @@ void _PyObject_VirtualFree(void *, size_t size);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* !Py_INTERNAL_PYMEM_H */ #endif // !Py_INTERNAL_PYMEM_H

View File

@ -1,17 +0,0 @@
#ifndef Py_INTERPRETERIDOBJECT_H
#define Py_INTERPRETERIDOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef Py_LIMITED_API
# define Py_CPYTHON_INTERPRETERIDOBJECT_H
# include "cpython/interpreteridobject.h"
# undef Py_CPYTHON_INTERPRETERIDOBJECT_H
#endif
#ifdef __cplusplus
}
#endif
#endif /* !Py_INTERPRETERIDOBJECT_H */

View File

@ -1143,7 +1143,6 @@ PYTHON_HEADERS= \
$(srcdir)/Include/floatobject.h \ $(srcdir)/Include/floatobject.h \
$(srcdir)/Include/frameobject.h \ $(srcdir)/Include/frameobject.h \
$(srcdir)/Include/import.h \ $(srcdir)/Include/import.h \
$(srcdir)/Include/interpreteridobject.h \
$(srcdir)/Include/intrcheck.h \ $(srcdir)/Include/intrcheck.h \
$(srcdir)/Include/iterobject.h \ $(srcdir)/Include/iterobject.h \
$(srcdir)/Include/listobject.h \ $(srcdir)/Include/listobject.h \
@ -1211,7 +1210,6 @@ PYTHON_HEADERS= \
$(srcdir)/Include/cpython/genobject.h \ $(srcdir)/Include/cpython/genobject.h \
$(srcdir)/Include/cpython/import.h \ $(srcdir)/Include/cpython/import.h \
$(srcdir)/Include/cpython/initconfig.h \ $(srcdir)/Include/cpython/initconfig.h \
$(srcdir)/Include/cpython/interpreteridobject.h \
$(srcdir)/Include/cpython/listobject.h \ $(srcdir)/Include/cpython/listobject.h \
$(srcdir)/Include/cpython/longintrepr.h \ $(srcdir)/Include/cpython/longintrepr.h \
$(srcdir)/Include/cpython/methodobject.h \ $(srcdir)/Include/cpython/methodobject.h \
@ -1260,6 +1258,7 @@ PYTHON_HEADERS= \
$(srcdir)/Include/internal/pycore_import.h \ $(srcdir)/Include/internal/pycore_import.h \
$(srcdir)/Include/internal/pycore_initconfig.h \ $(srcdir)/Include/internal/pycore_initconfig.h \
$(srcdir)/Include/internal/pycore_interp.h \ $(srcdir)/Include/internal/pycore_interp.h \
$(srcdir)/Include/internal/pycore_interpreteridobject.h \
$(srcdir)/Include/internal/pycore_list.h \ $(srcdir)/Include/internal/pycore_list.h \
$(srcdir)/Include/internal/pycore_long.h \ $(srcdir)/Include/internal/pycore_long.h \
$(srcdir)/Include/internal/pycore_moduleobject.h \ $(srcdir)/Include/internal/pycore_moduleobject.h \

View File

@ -0,0 +1,3 @@
Move the ``interpreteridobject.h`` header file from ``Include/`` to
``Include/internal/``. It only provides private functions. Patch by Victor
Stinner.

View File

@ -6,7 +6,7 @@
#include "frameobject.h" #include "frameobject.h"
#include "pycore_frame.h" #include "pycore_frame.h"
#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_pystate.h" // _PyThreadState_GET()
#include "interpreteridobject.h" #include "pycore_interpreteridobject.h"
static char * static char *

View File

@ -3,7 +3,7 @@
#include "Python.h" #include "Python.h"
#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_abstract.h" // _PyIndex_Check()
#include "pycore_interp.h" // _PyInterpreterState_LookUpID() #include "pycore_interp.h" // _PyInterpreterState_LookUpID()
#include "interpreteridobject.h" #include "pycore_interpreteridobject.h"
typedef struct interpid { typedef struct interpid {

View File

@ -16,7 +16,7 @@
#include "pycore_symtable.h" // PySTEntry_Type #include "pycore_symtable.h" // PySTEntry_Type
#include "pycore_unionobject.h" // _PyUnion_Type #include "pycore_unionobject.h" // _PyUnion_Type
#include "frameobject.h" // PyFrame_Type #include "frameobject.h" // PyFrame_Type
#include "interpreteridobject.h" // _PyInterpreterID_Type #include "pycore_interpreteridobject.h" // _PyInterpreterID_Type
#ifdef Py_LIMITED_API #ifdef Py_LIMITED_API
// Prevent recursive call _Py_IncRef() <=> Py_INCREF() // Prevent recursive call _Py_IncRef() <=> Py_INCREF()

View File

@ -138,7 +138,6 @@
<ClInclude Include="..\Include\cpython\genobject.h" /> <ClInclude Include="..\Include\cpython\genobject.h" />
<ClInclude Include="..\Include\cpython\import.h" /> <ClInclude Include="..\Include\cpython\import.h" />
<ClInclude Include="..\Include\cpython\initconfig.h" /> <ClInclude Include="..\Include\cpython\initconfig.h" />
<ClInclude Include="..\Include\cpython\interpreteridobject.h" />
<ClInclude Include="..\Include\cpython\listobject.h" /> <ClInclude Include="..\Include\cpython\listobject.h" />
<ClInclude Include="..\Include\cpython\longintrepr.h" /> <ClInclude Include="..\Include\cpython\longintrepr.h" />
<ClInclude Include="..\Include\cpython\methodobject.h" /> <ClInclude Include="..\Include\cpython\methodobject.h" />
@ -200,6 +199,7 @@
<ClInclude Include="..\Include\internal\pycore_import.h" /> <ClInclude Include="..\Include\internal\pycore_import.h" />
<ClInclude Include="..\Include\internal\pycore_initconfig.h" /> <ClInclude Include="..\Include\internal\pycore_initconfig.h" />
<ClInclude Include="..\Include\internal\pycore_interp.h" /> <ClInclude Include="..\Include\internal\pycore_interp.h" />
<ClInclude Include="..\Include\internal\pycore_interpreteridobject.h" />
<ClInclude Include="..\Include\internal\pycore_list.h" /> <ClInclude Include="..\Include\internal\pycore_list.h" />
<ClInclude Include="..\Include\internal\pycore_long.h" /> <ClInclude Include="..\Include\internal\pycore_long.h" />
<ClInclude Include="..\Include\internal\pycore_moduleobject.h" /> <ClInclude Include="..\Include\internal\pycore_moduleobject.h" />
@ -221,7 +221,6 @@
<ClInclude Include="..\Include\internal\pycore_ucnhash.h" /> <ClInclude Include="..\Include\internal\pycore_ucnhash.h" />
<ClInclude Include="..\Include\internal\pycore_unionobject.h" /> <ClInclude Include="..\Include\internal\pycore_unionobject.h" />
<ClInclude Include="..\Include\internal\pycore_warnings.h" /> <ClInclude Include="..\Include\internal\pycore_warnings.h" />
<ClInclude Include="..\Include\interpreteridobject.h" />
<ClInclude Include="..\Include\intrcheck.h" /> <ClInclude Include="..\Include\intrcheck.h" />
<ClInclude Include="..\Include\iterobject.h" /> <ClInclude Include="..\Include\iterobject.h" />
<ClInclude Include="..\Include\listobject.h" /> <ClInclude Include="..\Include\listobject.h" />

View File

@ -333,9 +333,6 @@
<ClInclude Include="..\Include\namespaceobject.h"> <ClInclude Include="..\Include\namespaceobject.h">
<Filter>Include</Filter> <Filter>Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\interpreteridobject.h">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\Modules\hashtable.h"> <ClInclude Include="..\Modules\hashtable.h">
<Filter>Modules</Filter> <Filter>Modules</Filter>
</ClInclude> </ClInclude>
@ -456,9 +453,6 @@
<ClInclude Include="..\Include\cpython\genobject.h"> <ClInclude Include="..\Include\cpython\genobject.h">
<Filter>Include</Filter> <Filter>Include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\cpython\interpreteridobject.h">
<Filter>Include\cpython</Filter>
</ClInclude>
<ClInclude Include="..\Include\cpython\pythonrun.h"> <ClInclude Include="..\Include\cpython\pythonrun.h">
<Filter>Include\cpython</Filter> <Filter>Include\cpython</Filter>
</ClInclude> </ClInclude>
@ -555,6 +549,9 @@
<ClInclude Include="..\Include\internal\pycore_interp.h"> <ClInclude Include="..\Include\internal\pycore_interp.h">
<Filter>Include\internal</Filter> <Filter>Include\internal</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Include\internal\pycore_interpreteridobject.h">
<Filter>Include\cpython</Filter>
</ClInclude>
<ClInclude Include="..\Include\internal\pycore_list.h"> <ClInclude Include="..\Include\internal\pycore_list.h">
<Filter>Include\internal</Filter> <Filter>Include\internal</Filter>
</ClInclude> </ClInclude>

View File

@ -172,7 +172,6 @@ Include/cpython/fileobject.h Py_CPYTHON_FILEOBJECT_H 1
Include/cpython/fileutils.h Py_CPYTHON_FILEUTILS_H 1 Include/cpython/fileutils.h Py_CPYTHON_FILEUTILS_H 1
Include/cpython/frameobject.h Py_CPYTHON_FRAMEOBJECT_H 1 Include/cpython/frameobject.h Py_CPYTHON_FRAMEOBJECT_H 1
Include/cpython/import.h Py_CPYTHON_IMPORT_H 1 Include/cpython/import.h Py_CPYTHON_IMPORT_H 1
Include/cpython/interpreteridobject.h Py_CPYTHON_INTERPRETERIDOBJECT_H 1
Include/cpython/listobject.h Py_CPYTHON_LISTOBJECT_H 1 Include/cpython/listobject.h Py_CPYTHON_LISTOBJECT_H 1
Include/cpython/methodobject.h Py_CPYTHON_METHODOBJECT_H 1 Include/cpython/methodobject.h Py_CPYTHON_METHODOBJECT_H 1
Include/cpython/object.h Py_CPYTHON_OBJECT_H 1 Include/cpython/object.h Py_CPYTHON_OBJECT_H 1