diff options
author | Victor Stinner <vstinner@python.org> | 2021-10-14 22:20:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-14 22:20:33 (GMT) |
commit | af1083e975b9627a5c97013d3a2b9aef0e4b333c (patch) | |
tree | 065625bdac161b18912ec7ef005692d61117cd04 /Include/marshal.h | |
parent | 0a883a76cda8205023c52211968bcf87bd47fd6e (diff) | |
download | cpython-af1083e975b9627a5c97013d3a2b9aef0e4b333c.zip cpython-af1083e975b9627a5c97013d3a2b9aef0e4b333c.tar.gz cpython-af1083e975b9627a5c97013d3a2b9aef0e4b333c.tar.bz2 |
bpo-45474: Fix the limited C API of marshal.h (GH-28956)
Remove two functions from the limited C API:
* PyMarshal_WriteLongToFile()
* PyMarshal_WriteObjectToFile()
The PEP 384 excludes functions expecting "FILE*" from the stable ABI.
Remove also the Py_MARSHAL_VERSION macro from the limited C API.
Diffstat (limited to 'Include/marshal.h')
-rw-r--r-- | Include/marshal.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Include/marshal.h b/Include/marshal.h index 09d9337..36ef6a7 100644 --- a/Include/marshal.h +++ b/Include/marshal.h @@ -7,20 +7,21 @@ extern "C" { #endif -#define Py_MARSHAL_VERSION 4 - -PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int); -PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int); +PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *, + Py_ssize_t); PyAPI_FUNC(PyObject *) PyMarshal_WriteObjectToString(PyObject *, int); #ifndef Py_LIMITED_API +#define Py_MARSHAL_VERSION 4 + PyAPI_FUNC(long) PyMarshal_ReadLongFromFile(FILE *); PyAPI_FUNC(int) PyMarshal_ReadShortFromFile(FILE *); PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromFile(FILE *); PyAPI_FUNC(PyObject *) PyMarshal_ReadLastObjectFromFile(FILE *); + +PyAPI_FUNC(void) PyMarshal_WriteLongToFile(long, FILE *, int); +PyAPI_FUNC(void) PyMarshal_WriteObjectToFile(PyObject *, FILE *, int); #endif -PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(const char *, - Py_ssize_t); #ifdef __cplusplus } |