]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
po-35134: Move Include/funcobject.h to Include/cpython/ (GH-28958)
authorVictor Stinner <vstinner@python.org>
Thu, 14 Oct 2021 23:50:28 +0000 (01:50 +0200)
committerGitHub <noreply@github.com>
Thu, 14 Oct 2021 23:50:28 +0000 (01:50 +0200)
Remove redundant "#ifndef Py_LIMITED_API" in funcobject.h.

Doc/whatsnew/3.11.rst
Include/Python.h
Include/cpython/funcobject.h [moved from Include/funcobject.h with 99% similarity]
Makefile.pre.in
Misc/NEWS.d/next/C API/2021-10-15-00-11-51.bpo-35134.eX4zqy.rst [new file with mode: 0644]
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters
Tools/scripts/stable_abi.py

index 0647774f400d69638773edd5986adf2117fa092b..a45568392fbf9f14ff51a113b6eb0b7f111fbf52 100644 (file)
@@ -572,6 +572,12 @@ Porting to Python 3.11
   header provides functions like ``printf()`` and ``fopen()``.
   (Contributed by Victor Stinner in :issue:`45434`.)
 
+* The non-limited API file ``funcobject.h`` has been moved to the
+  ``Include/cpython`` directory. This file must not be included directly, as it
+  is already included in ``Python.h``: :ref:`Include Files <api-includes>`. If
+  it has been included directly, consider including ``Python.h`` instead.
+  (Contributed by Victor Stinner in :issue:`35134`.)
+
 Deprecated
 ----------
 
index dc5c9b8e6384e8fe8cacf5c677b9030bb6046c43..e8e061bdf62e87efb325b862b90bf25b01c40caf 100644 (file)
@@ -60,7 +60,7 @@
 #include "setobject.h"
 #include "methodobject.h"
 #include "moduleobject.h"
-#include "funcobject.h"
+#include "cpython/funcobject.h"
 #include "classobject.h"
 #include "fileobject.h"
 #include "pycapsule.h"
similarity index 99%
rename from Include/funcobject.h
rename to Include/cpython/funcobject.h
index 6bc03f57d4cb39db6f35638a6ac1b5cbe2be37a6..60b702218a1f40d9dd556100f54316ab644137bf 100644 (file)
@@ -1,5 +1,5 @@
-
 /* Function object interface */
+
 #ifndef Py_LIMITED_API
 #ifndef Py_FUNCOBJECT_H
 #define Py_FUNCOBJECT_H
@@ -76,7 +76,6 @@ PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *);
 PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *);
 PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *);
 
-#ifndef Py_LIMITED_API
 PyAPI_FUNC(PyObject *) _PyFunction_Vectorcall(
     PyObject *func,
     PyObject *const *stack,
@@ -84,7 +83,6 @@ PyAPI_FUNC(PyObject *) _PyFunction_Vectorcall(
     PyObject *kwnames);
 
 uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func);
-#endif
 
 /* Macros for direct access to these values. Type checks are *not*
    done, so use with care. */
index 30b025e7efb83965bb7a0c7682eaf559a2af02e9..a5585c8de8ad0178100a1a5b746613859104d160 100644 (file)
@@ -1145,7 +1145,6 @@ PYTHON_HEADERS= \
                $(srcdir)/Include/fileutils.h \
                $(srcdir)/Include/floatobject.h \
                $(srcdir)/Include/frameobject.h \
-               $(srcdir)/Include/funcobject.h \
                $(srcdir)/Include/genobject.h \
                $(srcdir)/Include/import.h \
                $(srcdir)/Include/interpreteridobject.h \
@@ -1210,6 +1209,7 @@ PYTHON_HEADERS= \
                $(srcdir)/Include/cpython/fileutils.h \
                $(srcdir)/Include/cpython/floatobject.h \
                $(srcdir)/Include/cpython/frameobject.h \
+               $(srcdir)/Include/cpython/funcobject.h \
                $(srcdir)/Include/cpython/import.h \
                $(srcdir)/Include/cpython/initconfig.h \
                $(srcdir)/Include/cpython/interpreteridobject.h \
diff --git a/Misc/NEWS.d/next/C API/2021-10-15-00-11-51.bpo-35134.eX4zqy.rst b/Misc/NEWS.d/next/C API/2021-10-15-00-11-51.bpo-35134.eX4zqy.rst
new file mode 100644 (file)
index 0000000..fc12e02
--- /dev/null
@@ -0,0 +1,3 @@
+Move Include/funcobject.h header file to Include/cpython/funcobject.h.
+C extensions should only include the main ``<Python.h>`` header.
+Patch by Victor Stinner.
index f688e8a32324515342f8a794e66cf20e65fa7681..dc216e34855df2a0ca87e43c40c2852fd507bb53 100644 (file)
     <ClInclude Include="..\Include\cpython\fileutils.h" />
     <ClInclude Include="..\Include\cpython\floatobject.h" />
     <ClInclude Include="..\Include\cpython\frameobject.h" />
+    <ClInclude Include="..\Include\cpython\funcobject.h" />
     <ClInclude Include="..\Include\cpython\import.h" />
     <ClInclude Include="..\Include\cpython\initconfig.h" />
     <ClInclude Include="..\Include\cpython\interpreteridobject.h" />
     <ClInclude Include="..\Include\fileutils.h" />
     <ClInclude Include="..\Include\floatobject.h" />
     <ClInclude Include="..\Include\frameobject.h" />
-    <ClInclude Include="..\Include\funcobject.h" />
     <ClInclude Include="..\Include\genobject.h" />
     <ClInclude Include="..\Include\import.h" />
     <ClInclude Include="..\Include\internal\pycore_abstract.h" />
index eb72c38a7b2038d86776674d20a53201ae4a5b1a..8eeb38871f327e1f7ef072ede208e11d289b9a34 100644 (file)
     <ClInclude Include="..\Include\frameobject.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\funcobject.h">
-      <Filter>Include</Filter>
-    </ClInclude>
     <ClInclude Include="..\Include\genobject.h">
       <Filter>Include</Filter>
     </ClInclude>
     <ClInclude Include="..\Include\cpython\frameobject.h">
       <Filter>Include\cpython</Filter>
     </ClInclude>
+    <ClInclude Include="..\Include\cpython\funcobject.h">
+      <Filter>Include\cpython</Filter>
+    </ClInclude>
     <ClInclude Include="..\Include\cpython\interpreteridobject.h">
       <Filter>Include\cpython</Filter>
     </ClInclude>
index 6d7034090f8819480d3c4ab0d62dd952954cf378..6cb310e5a31d5ac56228b7dd0c3aab4685822640 100755 (executable)
@@ -34,7 +34,6 @@ EXCLUDED_HEADERS = {
     "datetime.h",
     "dtoa.h",
     "frameobject.h",
-    "funcobject.h",
     "genobject.h",
     "longintrepr.h",
     "parsetok.h",