mirror of https://github.com/python/cpython
gh-108240: Add pycore_capsule.h internal header file (#108596)
Move _PyCapsule_SetTraverse() definition to a new internal header file: pycore_capsule.h.
This commit is contained in:
parent
4fb96a11db
commit
39506ee565
|
@ -0,0 +1,17 @@
|
||||||
|
#ifndef Py_INTERNAL_PYCAPSULE_H
|
||||||
|
#define Py_INTERNAL_PYCAPSULE_H
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef Py_BUILD_CORE
|
||||||
|
# error "this header requires Py_BUILD_CORE define"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Export for '_socket' shared extension
|
||||||
|
PyAPI_FUNC(int) _PyCapsule_SetTraverse(PyObject *op, traverseproc traverse_func, inquiry clear_func);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /* !Py_INTERNAL_PYCAPSULE_H */
|
|
@ -48,15 +48,10 @@ PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name);
|
||||||
|
|
||||||
PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context);
|
PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context);
|
||||||
|
|
||||||
#ifdef Py_BUILD_CORE
|
|
||||||
PyAPI_FUNC(int) _PyCapsule_SetTraverse(PyObject *op, traverseproc traverse_func, inquiry clear_func);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
PyAPI_FUNC(void *) PyCapsule_Import(
|
PyAPI_FUNC(void *) PyCapsule_Import(
|
||||||
const char *name, /* UTF-8 encoded string */
|
const char *name, /* UTF-8 encoded string */
|
||||||
int no_block);
|
int no_block);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1743,6 +1743,7 @@ PYTHON_HEADERS= \
|
||||||
$(srcdir)/Include/internal/pycore_bytes_methods.h \
|
$(srcdir)/Include/internal/pycore_bytes_methods.h \
|
||||||
$(srcdir)/Include/internal/pycore_bytesobject.h \
|
$(srcdir)/Include/internal/pycore_bytesobject.h \
|
||||||
$(srcdir)/Include/internal/pycore_call.h \
|
$(srcdir)/Include/internal/pycore_call.h \
|
||||||
|
$(srcdir)/Include/internal/pycore_capsule.h \
|
||||||
$(srcdir)/Include/internal/pycore_ceval.h \
|
$(srcdir)/Include/internal/pycore_ceval.h \
|
||||||
$(srcdir)/Include/internal/pycore_ceval_state.h \
|
$(srcdir)/Include/internal/pycore_ceval_state.h \
|
||||||
$(srcdir)/Include/internal/pycore_code.h \
|
$(srcdir)/Include/internal/pycore_code.h \
|
||||||
|
|
|
@ -106,6 +106,7 @@ Local naming conventions:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
#include "pycore_capsule.h" // _PyCapsule_SetTraverse()
|
||||||
#include "pycore_dict.h" // _PyDict_Pop()
|
#include "pycore_dict.h" // _PyDict_Pop()
|
||||||
#include "pycore_fileutils.h" // _Py_set_inheritable()
|
#include "pycore_fileutils.h" // _Py_set_inheritable()
|
||||||
#include "pycore_moduleobject.h" // _PyModule_GetState
|
#include "pycore_moduleobject.h" // _PyModule_GetState
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* Wrap void * pointers to be passed between C modules */
|
/* Wrap void * pointers to be passed between C modules */
|
||||||
|
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
|
#include "pycore_capsule.h" // export _PyCapsule_SetTraverse()
|
||||||
#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED()
|
#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED()
|
||||||
#include "pycore_object.h" // _PyObject_GC_TRACK()
|
#include "pycore_object.h" // _PyObject_GC_TRACK()
|
||||||
|
|
||||||
|
|
|
@ -206,6 +206,7 @@
|
||||||
<ClInclude Include="..\Include\internal\pycore_bytes_methods.h" />
|
<ClInclude Include="..\Include\internal\pycore_bytes_methods.h" />
|
||||||
<ClInclude Include="..\Include\internal\pycore_bytesobject.h" />
|
<ClInclude Include="..\Include\internal\pycore_bytesobject.h" />
|
||||||
<ClInclude Include="..\Include\internal\pycore_call.h" />
|
<ClInclude Include="..\Include\internal\pycore_call.h" />
|
||||||
|
<ClInclude Include="..\Include\internal\pycore_capsule.h" />
|
||||||
<ClInclude Include="..\Include\internal\pycore_ceval.h" />
|
<ClInclude Include="..\Include\internal\pycore_ceval.h" />
|
||||||
<ClInclude Include="..\Include\internal\pycore_ceval_state.h" />
|
<ClInclude Include="..\Include\internal\pycore_ceval_state.h" />
|
||||||
<ClInclude Include="..\Include\internal\pycore_cfg.h" />
|
<ClInclude Include="..\Include\internal\pycore_cfg.h" />
|
||||||
|
|
|
@ -528,6 +528,9 @@
|
||||||
<ClInclude Include="..\Include\internal\pycore_call.h">
|
<ClInclude Include="..\Include\internal\pycore_call.h">
|
||||||
<Filter>Include\internal</Filter>
|
<Filter>Include\internal</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Include\internal\pycore_capsule.h">
|
||||||
|
<Filter>Include\internal</Filter>
|
||||||
|
</ClInclude>
|
||||||
<ClInclude Include="..\Include\internal\pycore_ceval.h">
|
<ClInclude Include="..\Include\internal\pycore_ceval.h">
|
||||||
<Filter>Include\internal</Filter>
|
<Filter>Include\internal</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|
Loading…
Reference in New Issue