FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-85283: Build errno and _ctypes_test with limited C API by vstinner · Pull Request #110955 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (3) .rst  (2) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions Doc/whatsnew/3.13.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -932,8 +932,8 @@ 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`` and ``_testimportmultiple`` C extensions are now built with the
:ref:`limited C API <limited-c-api>`.
* The ``errno``, ``_ctypes_test``, ``_stat`` and ``_testimportmultiple`` C
extensions are now built with the :ref:`limited C API <limited-c-api>`.
(Contributed by Victor Stinner in :gh:`85283`.)


Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
The ``_testimportmultiple`` C extension is now built with the :ref:`limited
C API <limited-c-api>`. Patch by Victor Stinner.
The ``errno``, ``_ctypes_test`` and ``_testimportmultiple`` C extensions are
now built with the :ref:`limited C API <limited-c-api>`. Patch by Victor
Stinner.
7 changes: 4 additions & 3 deletions Modules/_ctypes/_ctypes_test.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#define Py_LIMITED_API 0x03060000

#include <Python.h>

#include <stdlib.h> // qsort()
#ifdef MS_WIN32
#include <windows.h>
# include <windows.h>
#endif

#include <stdlib.h> // qsort()

#define EXPORT(x) Py_EXPORTED_SYMBOL x

/* some functions handy for testing */
Expand Down
2 changes: 1 addition & 1 deletion Modules/_testimportmultiple.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* foo, bar), only the first one is called the same as the compiled file.
*/

#define Py_LIMITED_API 0x030d0000
#define Py_LIMITED_API 0x03020000

#include <Python.h>

Expand Down
67 changes: 35 additions & 32 deletions Modules/errnomodule.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@

/* Errno module */

// Need PyModuleDef_Slot added to limited C API version 3.5
#define Py_LIMITED_API 0x03050000

#include "Python.h"

/* Windows socket errors (WSA*) */
#ifdef MS_WINDOWS
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
/* The following constants were added to errno.h in VS2010 but have
preferred WSA equivalents. */
#undef EADDRINUSE
#undef EADDRNOTAVAIL
#undef EAFNOSUPPORT
#undef EALREADY
#undef ECONNABORTED
#undef ECONNREFUSED
#undef ECONNRESET
#undef EDESTADDRREQ
#undef EHOSTUNREACH
#undef EINPROGRESS
#undef EISCONN
#undef ELOOP
#undef EMSGSIZE
#undef ENETDOWN
#undef ENETRESET
#undef ENETUNREACH
#undef ENOBUFS
#undef ENOPROTOOPT
#undef ENOTCONN
#undef ENOTSOCK
#undef EOPNOTSUPP
#undef EPROTONOSUPPORT
#undef EPROTOTYPE
#undef ETIMEDOUT
#undef EWOULDBLOCK
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>

// The following constants were added to errno.h in VS2010 but have
// preferred WSA equivalents.
# undef EADDRINUSE
# undef EADDRNOTAVAIL
# undef EAFNOSUPPORT
# undef EALREADY
# undef ECONNABORTED
# undef ECONNREFUSED
# undef ECONNRESET
# undef EDESTADDRREQ
# undef EHOSTUNREACH
# undef EINPROGRESS
# undef EISCONN
# undef ELOOP
# undef EMSGSIZE
# undef ENETDOWN
# undef ENETRESET
# undef ENETUNREACH
# undef ENOBUFS
# undef ENOPROTOOPT
# undef ENOTCONN
# undef ENOTSOCK
# undef EOPNOTSUPP
# undef EPROTONOSUPPORT
# undef EPROTOTYPE
# undef ETIMEDOUT
# undef EWOULDBLOCK
#endif

/*
Expand Down

Back | FazBrowse Home | New Git URL