bpo-39947: Move Py_EnterRecursiveCall() to internal C API (GH-18972)
Move the static inline function flavor of Py_EnterRecursiveCall() and
Py_LeaveRecursiveCall() to the internal C API: they access
PyThreadState attributes. The limited C API provides regular
functions which hide implementation details.
diff --git a/Objects/abstract.c b/Objects/abstract.c
index f9be422..02e4ad7 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -1,6 +1,7 @@
/* Abstract Object Interface (many thanks to Jim Fulton) */
#include "Python.h"
+#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
#include "pycore_pyerrors.h"
#include "pycore_pystate.h"
#include <ctype.h>
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index b448ec6..cb7572b 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -1,6 +1,7 @@
/* Descriptors -- a new, flexible way to describe attributes */
#include "Python.h"
+#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
#include "pycore_object.h"
#include "pycore_pystate.h"
#include "pycore_tupleobject.h"
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 16abded..44ae00f 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -2,6 +2,7 @@
/* Method object implementation */
#include "Python.h"
+#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
#include "pycore_object.h"
#include "pycore_pyerrors.h"
#include "pycore_pymem.h"
diff --git a/Objects/object.c b/Objects/object.c
index bb47cfa..72c4189 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -2,6 +2,7 @@
/* Generic object operations; and implementation of None */
#include "Python.h"
+#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
#include "pycore_context.h"
#include "pycore_initconfig.h"
#include "pycore_object.h"