bpo-45434: Only exclude <stdlib.h> in Python 3.11 limited C API#29027
bpo-45434: Only exclude <stdlib.h> in Python 3.11 limited C API#29027vstinner merged 3 commits intopython:mainpython/cpython:mainfrom vstinner:capi_compatCopy head branch name to clipboard
Conversation
The Python 3.11 limited C API no longer includes stdlib.h, stdio.h, string.h and errno.h. * Exclude Py_MEMCPY() from Python 3.11 limited C API. * xxlimited C extension is now built with Python 3.11 limited C API.
|
@Yhg1s @ronaldoussoren @encukou @tiran: Does it look a reasonable approach to you? Only change the Python 3.11 limited C API, but leave other APIs unchanged? |
|
I not sure if doing this is worth the effort, this makes the headers more complicated and only affects the few extensions that target the stable ABI and want to use API's introduced in 3.11. |
I think it's worth doing. In the long run it's going to make |
|
@tiran: I addresssed your review. |
You only have to do this update work once. Once you added the missing |
Doc/whatsnew/3.11.rst
Outdated
| * The Python 3.11 limited C API no longer includes ``<stdlib.h>``, | ||
| ``<stdio.h>``, ``<errno.h>`` and ``<string.h>``: | ||
| if ``Py_LIMITED_API >= 0x030b0000``. C extensions using these headers must | ||
| now include them explicitly. |
There was a problem hiding this comment.
The whatsnew entry is hard to understand.
| * The Python 3.11 limited C API no longer includes ``<stdlib.h>``, | |
| ``<stdio.h>``, ``<errno.h>`` and ``<string.h>``: | |
| if ``Py_LIMITED_API >= 0x030b0000``. C extensions using these headers must | |
| now include them explicitly. | |
| * ``<Python.h>`` no longer includes the header files ``<stdlib.h>``, | |
| ``<stdio.h>``, ``<errno.h>`` and ``<string.h>`` when ``Py_LIMITED_API`` | |
| is set to ``0x030b0000`` (3.11) or higher. C extensions should explicitly | |
| include the header files after ``#include <Python.h>``. |
There was a problem hiding this comment.
I confess that it's hard to understand. I copied your rephrased paragraph, thanks.
The Python 3.11 limited C API no longer includes stdlib.h, stdio.h,
string.h and errno.h.
https://bugs.python.org/issue45434