diff options
author | Victor Stinner <vstinner@python.org> | 2023-08-29 01:20:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-29 01:20:02 (GMT) |
commit | 39506ee565ce819e14e8071227fc53b8dcb6a788 (patch) | |
tree | 999ccd8c1607099b7bac889089341ba32c193986 /Include | |
parent | 4fb96a11db5eaca3646bfa697d191469e567d283 (diff) | |
download | cpython-39506ee565ce819e14e8071227fc53b8dcb6a788.zip cpython-39506ee565ce819e14e8071227fc53b8dcb6a788.tar.gz cpython-39506ee565ce819e14e8071227fc53b8dcb6a788.tar.bz2 |
gh-108240: Add pycore_capsule.h internal header file (#108596)
Move _PyCapsule_SetTraverse() definition to a new internal header
file: pycore_capsule.h.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_capsule.h | 17 | ||||
-rw-r--r-- | Include/pycapsule.h | 5 |
2 files changed, 17 insertions, 5 deletions
diff --git a/Include/internal/pycore_capsule.h b/Include/internal/pycore_capsule.h new file mode 100644 index 0000000..aa2c67f --- /dev/null +++ b/Include/internal/pycore_capsule.h @@ -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 */ diff --git a/Include/pycapsule.h b/Include/pycapsule.h index 8660e83..666b9f8 100644 --- a/Include/pycapsule.h +++ b/Include/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); -#ifdef Py_BUILD_CORE -PyAPI_FUNC(int) _PyCapsule_SetTraverse(PyObject *op, traverseproc traverse_func, inquiry clear_func); -#endif - PyAPI_FUNC(void *) PyCapsule_Import( const char *name, /* UTF-8 encoded string */ int no_block); - #ifdef __cplusplus } #endif |