diff options
author | Victor Stinner <vstinner@python.org> | 2023-08-26 01:18:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-26 01:18:09 (GMT) |
commit | 6353c21b78a3d91e7cd7810f1c00258a34e85fe7 (patch) | |
tree | fdb9e8068ae4f9fd472718cea32dab935b5064a6 /Include | |
parent | 713afb8804666405f29115cf459b591308e3ab54 (diff) | |
download | cpython-6353c21b78a3d91e7cd7810f1c00258a34e85fe7.zip cpython-6353c21b78a3d91e7cd7810f1c00258a34e85fe7.tar.gz cpython-6353c21b78a3d91e7cd7810f1c00258a34e85fe7.tar.bz2 |
gh-106320: Remove private _PyLong_FileDescriptor_Converter() (#108503)
Move the private _PyLong converter functions to the internal C API
* _PyLong_FileDescriptor_Converter(): moved to pycore_fileutils.h
* _PyLong_Size_t_Converter(): moved to pycore_long.h
Argument Clinic now emits includes for pycore_fileutils.h and
pycore_long.h when these functions are used.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/fileobject.h | 2 | ||||
-rw-r--r-- | Include/cpython/longobject.h | 2 | ||||
-rw-r--r-- | Include/internal/pycore_fileutils.h | 3 | ||||
-rw-r--r-- | Include/internal/pycore_long.h | 10 |
4 files changed, 13 insertions, 4 deletions
diff --git a/Include/cpython/fileobject.h b/Include/cpython/fileobject.h index b70ec31..6fbe696 100644 --- a/Include/cpython/fileobject.h +++ b/Include/cpython/fileobject.h @@ -15,5 +15,3 @@ typedef PyObject * (*Py_OpenCodeHookFunction)(PyObject *, void *); PyAPI_FUNC(PyObject *) PyFile_OpenCode(const char *utf8path); PyAPI_FUNC(PyObject *) PyFile_OpenCodeObject(PyObject *path); PyAPI_FUNC(int) PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction hook, void *userData); - -PyAPI_FUNC(int) _PyLong_FileDescriptor_Converter(PyObject *, void *); diff --git a/Include/cpython/longobject.h b/Include/cpython/longobject.h index c7ae1c2..32c40b0 100644 --- a/Include/cpython/longobject.h +++ b/Include/cpython/longobject.h @@ -2,8 +2,6 @@ # error "this header file must not be included directly" #endif -PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *); - PyAPI_FUNC(PyObject*) PyLong_FromUnicodeObject(PyObject *u, int base); /* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0. diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h index 90c0878..f6e6258 100644 --- a/Include/internal/pycore_fileutils.h +++ b/Include/internal/pycore_fileutils.h @@ -312,6 +312,9 @@ extern HRESULT PathCchSkipRoot(const wchar_t *pszPath, const wchar_t **ppszRootE # define _Py_END_SUPPRESS_IPH #endif /* _MSC_VER >= 1900 */ +// Export for 'select' shared extension (Argument Clinic code) +PyAPI_FUNC(int) _PyLong_FileDescriptor_Converter(PyObject *, void *); + #ifdef __cplusplus } #endif diff --git a/Include/internal/pycore_long.h b/Include/internal/pycore_long.h index 1dc5b74..c9d8271 100644 --- a/Include/internal/pycore_long.h +++ b/Include/internal/pycore_long.h @@ -187,11 +187,21 @@ extern char* _PyLong_FormatBytesWriter( int alternate); // Argument converters used by Argument Clinic + +// Export for 'select' shared extension (Argument Clinic code) PyAPI_FUNC(int) _PyLong_UnsignedShort_Converter(PyObject *, void *); + +// Export for '_testclinic' shared extension (Argument Clinic code) PyAPI_FUNC(int) _PyLong_UnsignedInt_Converter(PyObject *, void *); + +// Export for '_blake2' shared extension (Argument Clinic code) PyAPI_FUNC(int) _PyLong_UnsignedLong_Converter(PyObject *, void *); + +// Export for '_blake2' shared extension (Argument Clinic code) PyAPI_FUNC(int) _PyLong_UnsignedLongLong_Converter(PyObject *, void *); +// Export for '_testclinic' shared extension (Argument Clinic code) +PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *); /* Long value tag bits: * 0-1: Sign bits value = (1-sign), ie. negative=2, positive=0, zero=1. |