Mailing List Archive

gh-118207: Rename the COMMON_FIELDS macro in funcobject.h and undef it after use (GH-118208)
https://github.com/python/cpython/commit/796b3fb28057948ea5b98f7eb0c0f3af6a1e276e
commit: 796b3fb28057948ea5b98f7eb0c0f3af6a1e276e
branch: main
author: Itamar Oren <itamarost@gmail.com>
committer: encukou <encukou@gmail.com>
date: 2024-04-25T08:49:15+02:00
summary:

gh-118207: Rename the COMMON_FIELDS macro in funcobject.h and undef it after use (GH-118208)

files:
M Include/cpython/funcobject.h

diff --git a/Include/cpython/funcobject.h b/Include/cpython/funcobject.h
index de2013323d2c72..5433ba48eefc69 100644
--- a/Include/cpython/funcobject.h
+++ b/Include/cpython/funcobject.h
@@ -8,7 +8,7 @@ extern "C" {
#endif


-#define COMMON_FIELDS(PREFIX) \
+#define _Py_COMMON_FIELDS(PREFIX) \
PyObject *PREFIX ## globals; \
PyObject *PREFIX ## builtins; \
PyObject *PREFIX ## name; \
@@ -19,7 +19,7 @@ extern "C" {
PyObject *PREFIX ## closure; /* NULL or a tuple of cell objects */

typedef struct {
- COMMON_FIELDS(fc_)
+ _Py_COMMON_FIELDS(fc_)
} PyFrameConstructor;

/* Function objects and code objects should not be confused with each other:
@@ -35,7 +35,7 @@ typedef struct {

typedef struct {
PyObject_HEAD
- COMMON_FIELDS(func_)
+ _Py_COMMON_FIELDS(func_)
PyObject *func_doc; /* The __doc__ attribute, can be anything */
PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */
PyObject *func_weakreflist; /* List of weak references */
@@ -60,6 +60,8 @@ typedef struct {
*/
} PyFunctionObject;

+#undef _Py_COMMON_FIELDS
+
PyAPI_DATA(PyTypeObject) PyFunction_Type;

#define PyFunction_Check(op) Py_IS_TYPE((op), &PyFunction_Type)

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-leave@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: list-python-checkins@lists.gossamer-threads.com