◐ Shell
reader mode source ↗
Skip to content

bpo-45434: Only exclude <stdlib.h> in Python 3.11 limited C API#29027

Merged
vstinner merged 3 commits into
python:mainfrom
vstinner:capi_compat
Oct 19, 2021
Merged

bpo-45434: Only exclude <stdlib.h> in Python 3.11 limited C API#29027
vstinner merged 3 commits into
python:mainfrom
vstinner:capi_compat

Conversation

@vstinner

@vstinner vstinner commented Oct 18, 2021

Copy link
Copy Markdown
Member

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.

https://bugs.python.org/issue45434

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.
@vstinner

Copy link
Copy Markdown
Member Author

@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?

@ronaldoussoren

Copy link
Copy Markdown
Contributor

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.

@tiran

tiran commented Oct 18, 2021

Copy link
Copy Markdown
Member

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 Python.h lean and mean.

@vstinner

Copy link
Copy Markdown
Member Author

@tiran: I addresssed your review.

@vstinner

Copy link
Copy Markdown
Member Author

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.

You only have to do this update work once. Once you added the missing #include, the code remains compatible with older Python versions, and becomes "future proof" (no need to add again these include).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants