]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-98410: move getbufferproc and releasebufferproc to buffer.h (#31158)
authorDavid Hewitt <1939362+davidhewitt@users.noreply.github.com>
Mon, 31 Oct 2022 14:01:32 +0000 (14:01 +0000)
committerGitHub <noreply@github.com>
Mon, 31 Oct 2022 14:01:32 +0000 (15:01 +0100)
This adds them to the Limited API.

Doc/data/stable_abi.dat
Include/cpython/object.h
Include/pybuffer.h
Misc/NEWS.d/next/C API/2022-10-25-17-50-43.gh-issue-98410.NSXYfm.rst [new file with mode: 0644]
Misc/stable_abi.toml

index 133658491c5a4fb218fea126feeadf57b50bdea9..db8fc15d93d15a0c5ca88c20671de19b4b10aac3 100644 (file)
@@ -865,6 +865,7 @@ type,descrsetfunc,3.2,,
 type,destructor,3.2,,
 type,getattrfunc,3.2,,
 type,getattrofunc,3.2,,
+type,getbufferproc,3.12,,
 type,getiterfunc,3.2,,
 type,getter,3.2,,
 type,hashfunc,3.2,,
@@ -875,6 +876,7 @@ type,lenfunc,3.2,,
 type,newfunc,3.2,,
 type,objobjargproc,3.2,,
 type,objobjproc,3.2,,
+type,releasebufferproc,3.12,,
 type,reprfunc,3.2,,
 type,richcmpfunc,3.2,,
 type,setattrfunc,3.2,,
index 900b52321dff9fb0c3de3bd8b7ccbc2b587565d8..fa0cfb24484952c9e4c17e68b32654e3c70daa90 100644 (file)
@@ -51,10 +51,6 @@ typedef struct _Py_Identifier {
 
 #endif  /* NEEDS_PY_IDENTIFIER */
 
-typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
-typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
-
-
 typedef struct {
     /* Number implementations must check *both*
        arguments for proper type and implement the necessary conversions
index 6893505e66e3e812448d651451cca5e194e0f88f..bbac60972f5127634ce07877a83817f994b995b2 100644 (file)
@@ -32,6 +32,9 @@ typedef struct {
     void *internal;
 } Py_buffer;
 
+typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
+typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
+
 /* Return 1 if the getbuffer function is available, otherwise return 0. */
 PyAPI_FUNC(int) PyObject_CheckBuffer(PyObject *obj);
 
diff --git a/Misc/NEWS.d/next/C API/2022-10-25-17-50-43.gh-issue-98410.NSXYfm.rst b/Misc/NEWS.d/next/C API/2022-10-25-17-50-43.gh-issue-98410.NSXYfm.rst
new file mode 100644 (file)
index 0000000..d98bc4e
--- /dev/null
@@ -0,0 +1 @@
+Add ``getbufferproc`` and ``releasebufferproc`` to the stable API.
index e18a6e8f6a9c2c79b1a85832e5da245ff3e32cdd..0ba0f51b2de4514647e60f3d34405a7813bb2392 100644 (file)
     added = '3.12'
 [macro.PY_VECTORCALL_ARGUMENTS_OFFSET]
     added = '3.12'
+[typedef.getbufferproc]
+    added = '3.12'
+[typedef.releasebufferproc]
+    added = '3.12'