]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45434: Remove Include/eval.h header file (GH-28973)
authorVictor Stinner <vstinner@python.org>
Fri, 15 Oct 2021 11:06:05 +0000 (13:06 +0200)
committerGitHub <noreply@github.com>
Fri, 15 Oct 2021 11:06:05 +0000 (13:06 +0200)
Move Include/eval.h content into Include/ceval.h and
Include/cpython/ceval.h, and remove Include/eval.h.

Doc/faq/extending.rst
Doc/faq/windows.rst
Doc/whatsnew/3.11.rst
Include/Python.h
Include/ceval.h
Include/cpython/ceval.h
Include/eval.h [deleted file]
Makefile.pre.in
Misc/NEWS.d/next/C API/2021-10-15-00-11-51.bpo-35134.eX4zqy.rst
PCbuild/pythoncore.vcxproj
PCbuild/pythoncore.vcxproj.filters

index 3379e41d9de0724eb0a456c8c4fe8d060468c4f1..fd32b097335e536f92f2215fabaa2b80887c1da1 100644 (file)
@@ -290,9 +290,6 @@ complete example using the GNU readline library (you may want to ignore
 
    #define PY_SSIZE_T_CLEAN
    #include <Python.h>
-   #include <object.h>
-   #include <compile.h>
-   #include <eval.h>
 
    int main (int argc, char* argv[])
    {
index 0153a4f316ee823012f9a8f26937d4823a5bd97f..6b95819c8ee8555bf2a38109d21d599d095b8492 100644 (file)
@@ -212,7 +212,7 @@ Embedding the Python interpreter in a Windows app can be summarized as follows:
 
    .. code-block:: c
 
-      #include "python.h"
+      #include <Python.h>
       ...
       Py_Initialize();  // Initialize Python.
       initmyAppc();  // Initialize (import) the helper class.
index 2e952281865799d1f39392db7fa2e9381abf394c..994fb843fd3777ce653a3e8cb473ea7f0197d7fa 100644 (file)
@@ -573,11 +573,11 @@ Porting to Python 3.11
   (Contributed by Victor Stinner in :issue:`45434`.)
 
 * The non-limited API files ``cellobject.h``, ``classobject.h``, ``context.h``,
-  ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have been
-  moved to the ``Include/cpython`` directory. These files must not be included
-  directly, as they are already included in ``Python.h``: :ref:`Include Files
-  <api-includes>`. If they have been included directly, consider including
-  ``Python.h`` instead.
+  ``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have been moved to
+  the ``Include/cpython`` directory. Moreover, the ``eval.h`` header file was
+  removed. These files must not be included directly, as they are already
+  included in ``Python.h``: :ref:`Include Files <api-includes>`. If they have
+  been included directly, consider including ``Python.h`` instead.
   (Contributed by Victor Stinner in :issue:`35134`.)
 
 Deprecated
index bc8d4f9b548894716585963f47a887e3df281da6..a2de514702f2fb6a4add44bd7f8a391cb6ab97aa 100644 (file)
@@ -96,7 +96,6 @@
 #include "import.h"
 #include "abstract.h"
 #include "bltinmodule.h"
-#include "eval.h"
 #include "cpython/pyctype.h"
 #include "pystrtod.h"
 #include "pystrcmp.h"
index cf8c5b17be589a80545f4c2064e3e0a5df66c5ed..1b57f6ea20f6f069bb71a3b2191f955ac56f0fac 100644 (file)
@@ -1,3 +1,5 @@
+/* Interface to random parts in ceval.c */
+
 #ifndef Py_CEVAL_H
 #define Py_CEVAL_H
 #ifdef __cplusplus
@@ -5,7 +7,15 @@ extern "C" {
 #endif
 
 
-/* Interface to random parts in ceval.c */
+PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *);
+
+PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyObject *co,
+                                         PyObject *globals,
+                                         PyObject *locals,
+                                         PyObject *const *args, int argc,
+                                         PyObject *const *kwds, int kwdc,
+                                         PyObject *const *defs, int defc,
+                                         PyObject *kwdefs, PyObject *closure);
 
 /* PyEval_CallObjectWithKeywords(), PyEval_CallObject(), PyEval_CallFunction
  * and PyEval_CallMethod are deprecated. Since they are officially part of the
index 44b78f6d2231204c3b4dbb645dd78b4f0c8256e4..caf64401307c072945bb41700d671f84c76534b2 100644 (file)
@@ -2,6 +2,8 @@
 #  error "this header file must not be included directly"
 #endif
 
+PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args);
+
 PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
 PyAPI_DATA(int) _PyEval_SetProfile(PyThreadState *tstate, Py_tracefunc func, PyObject *arg);
 PyAPI_FUNC(void) PyEval_SetTrace(Py_tracefunc, PyObject *);
diff --git a/Include/eval.h b/Include/eval.h
deleted file mode 100644 (file)
index eda28df..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-
-/* Interface to execute compiled code */
-
-#ifndef Py_EVAL_H
-#define Py_EVAL_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-PyAPI_FUNC(PyObject *) PyEval_EvalCode(PyObject *, PyObject *, PyObject *);
-
-PyAPI_FUNC(PyObject *) PyEval_EvalCodeEx(PyObject *co,
-                                         PyObject *globals,
-                                         PyObject *locals,
-                                         PyObject *const *args, int argc,
-                                         PyObject *const *kwds, int kwdc,
-                                         PyObject *const *defs, int defc,
-                                         PyObject *kwdefs, PyObject *closure);
-
-#ifndef Py_LIMITED_API
-PyAPI_FUNC(PyObject *) _PyEval_CallTracing(PyObject *func, PyObject *args);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* !Py_EVAL_H */
index ccce52b36c42e202d7b626b91dca2bcf7dfc410a..b79b71f59b1459a7251fb121f5eac35ac3237378 100644 (file)
@@ -1137,7 +1137,6 @@ PYTHON_HEADERS= \
                $(srcdir)/Include/dynamic_annotations.h \
                $(srcdir)/Include/enumobject.h \
                $(srcdir)/Include/errcode.h \
-               $(srcdir)/Include/eval.h \
                $(srcdir)/Include/fileobject.h \
                $(srcdir)/Include/fileutils.h \
                $(srcdir)/Include/floatobject.h \
index 4ab10884a54922ecac333c37468146a5c6dd2ffe..d0d3ce6b34f6f1b162ba9ca946ad8ea3b6cfcf6b 100644 (file)
@@ -1,4 +1,7 @@
-Move ``cellobject.h``, ``classobject.h``, ``context.h``, ``funcobject.h``,
-``genobject.h`` and ``longintrepr.h`` header files from ``Include/`` to
-``Include/cpython/``. C extensions should only include the main ``<Python.h>``
-header. Patch by Victor Stinner.
+The non-limited API files ``cellobject.h``, ``classobject.h``, ``context.h``,
+``funcobject.h``, ``genobject.h`` and ``longintrepr.h`` have been moved to
+the ``Include/cpython`` directory. Moreover, the ``eval.h`` header file was
+removed. These files must not be included directly, as they are already
+included in ``Python.h``: :ref:`Include Files <api-includes>`. If they have
+been included directly, consider including ``Python.h`` instead.
+Patch by Victor Stinner.
index 32511d2a66511326f2a7fecbf215e72e21a71d89..357d0a7071031c30712f3ae3dbc10494e03263fc 100644 (file)
     <ClInclude Include="..\Include\dynamic_annotations.h" />
     <ClInclude Include="..\Include\enumobject.h" />
     <ClInclude Include="..\Include\errcode.h" />
-    <ClInclude Include="..\Include\eval.h" />
     <ClInclude Include="..\Include\fileobject.h" />
     <ClInclude Include="..\Include\fileutils.h" />
     <ClInclude Include="..\Include\floatobject.h" />
index 4cc1092b33a496872e864a6880feab08f2108827..1a3ad884d4ac3ee4b2d6181fbfd003c1deb6e027 100644 (file)
@@ -84,9 +84,6 @@
     <ClInclude Include="..\Include\errcode.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\eval.h">
-      <Filter>Include</Filter>
-    </ClInclude>
     <ClInclude Include="..\Include\fileobject.h">
       <Filter>Include</Filter>
     </ClInclude>