Skip to content

Commit 796b3fb

Browse files
authored
gh-118207: Rename the COMMON_FIELDS macro in funcobject.h and undef it after use (GH-118208)
1 parent 546cbcf commit 796b3fb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Include/cpython/funcobject.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern "C" {
88
#endif
99

1010

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

2121
typedef struct {
22-
COMMON_FIELDS(fc_)
22+
_Py_COMMON_FIELDS(fc_)
2323
} PyFrameConstructor;
2424

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

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

63+
#undef _Py_COMMON_FIELDS
64+
6365
PyAPI_DATA(PyTypeObject) PyFunction_Type;
6466

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

0 commit comments

Comments
 (0)