]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-85283: _stat extension now uses the limited C API (#110711)
authorVictor Stinner <vstinner@python.org>
Wed, 11 Oct 2023 22:06:20 +0000 (00:06 +0200)
committerGitHub <noreply@github.com>
Wed, 11 Oct 2023 22:06:20 +0000 (00:06 +0200)
gh-85283: _stat extension uses the limited C API

The _stat C extension is now built with the limited C API.

Doc/whatsnew/3.13.rst
Misc/NEWS.d/next/Build/2023-08-29-15-05-09.gh-issue-85283.tlK7G7.rst [new file with mode: 0644]
Modules/_stat.c

index b0a0d89c8d95195021965a260071d9c62f67b7d2..dfce976fbb50eebf04509310992d032b7585868b 100644 (file)
@@ -928,6 +928,10 @@ Build Changes
 * Building CPython now requires a compiler with support for the C11 atomic
   library, GCC built-in atomic functions, or MSVC interlocked intrinsics.
 
+* The ``_stat`` C extension is now built with the :ref:`limited C API
+  <limited-c-api>`.
+  (Contributed by Victor Stinner in :gh:`85283`.)
+
 
 C API Changes
 =============
diff --git a/Misc/NEWS.d/next/Build/2023-08-29-15-05-09.gh-issue-85283.tlK7G7.rst b/Misc/NEWS.d/next/Build/2023-08-29-15-05-09.gh-issue-85283.tlK7G7.rst
new file mode 100644 (file)
index 0000000..09b5661
--- /dev/null
@@ -0,0 +1,2 @@
+The ``_stat`` C extension is now built with the :ref:`limited C API
+<limited-c-api>`. Patch by Victor Stinner.
index 3fd951b6fc1022c6adac20ea48e51b61bede32a5..402fbbaecf8dd8ac271de09b6ee25e34782e800a 100644 (file)
@@ -11,6 +11,9 @@
  *
  */
 
+// Need limited C API version 3.13 for PyModule_Add() on Windows
+#define Py_LIMITED_API 0x030d0000
+
 #include "Python.h"
 
 #ifdef HAVE_SYS_TYPES_H