From: Victor Stinner Date: Tue, 31 Oct 2023 20:53:57 +0000 (+0100) Subject: gh-108765: Python.h no longer includes on Windows (#111563) X-Git-Tag: v3.13.0a2~252 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=faa5f6053d7334a3ecc513c64947ac026439c03a;p=thirdparty%2FPython%2Fcpython.git gh-108765: Python.h no longer includes on Windows (#111563) In practice, only Windows is impacted, because the HAVE_STDDEF_H macro was only defined on Windows. --- diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst index 3a2df4fc8a3d..197790234a15 100644 --- a/Doc/whatsnew/3.13.rst +++ b/Doc/whatsnew/3.13.rst @@ -1186,6 +1186,14 @@ Porting to Python 3.13 ``PyUnicode_AsUTF8AndSize(unicode, NULL)`` can be used instead. (Contributed by Victor Stinner in :gh:`111089`.) +* On Windows, ``Python.h`` no longer includes the ```` standard + header file. If needed, it should now be included explicitly. For example, it + provides ``offsetof()`` function, and ``size_t`` and ``ptrdiff_t`` types. + Including ```` explicitly was already needed by all other + platforms, the ``HAVE_STDDEF_H`` macro is only defined on Windows. + (Contributed by Victor Stinner in :gh:`108765`.) + + Deprecated ---------- diff --git a/Include/Python.h b/Include/Python.h index 7312cc87d5cc..a1f26afbb122 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -22,9 +22,6 @@ #include // HUGE_VAL #include // va_list #include // wchar_t -#ifdef HAVE_STDDEF_H -# include // size_t -#endif #ifdef HAVE_SYS_TYPES_H # include // ssize_t #endif diff --git a/Misc/NEWS.d/next/C API/2023-10-31-18-22-03.gh-issue-108765._beYv8.rst b/Misc/NEWS.d/next/C API/2023-10-31-18-22-03.gh-issue-108765._beYv8.rst new file mode 100644 index 000000000000..14af79eaea9a --- /dev/null +++ b/Misc/NEWS.d/next/C API/2023-10-31-18-22-03.gh-issue-108765._beYv8.rst @@ -0,0 +1,3 @@ +On Windows, ``Python.h`` no longer includes the ```` standard +header file. If needed, it should now be included explicitly. Patch by +Victor Stinner.