gh-118207: Rename the COMMON_FIELDS macro in funcobject.h and undef it after use (GH-118208)
This commit is contained in:
parent
546cbcfa0e
commit
796b3fb280
@ -8,7 +8,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define COMMON_FIELDS(PREFIX) \
|
#define _Py_COMMON_FIELDS(PREFIX) \
|
||||||
PyObject *PREFIX ## globals; \
|
PyObject *PREFIX ## globals; \
|
||||||
PyObject *PREFIX ## builtins; \
|
PyObject *PREFIX ## builtins; \
|
||||||
PyObject *PREFIX ## name; \
|
PyObject *PREFIX ## name; \
|
||||||
@ -19,7 +19,7 @@ extern "C" {
|
|||||||
PyObject *PREFIX ## closure; /* NULL or a tuple of cell objects */
|
PyObject *PREFIX ## closure; /* NULL or a tuple of cell objects */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
COMMON_FIELDS(fc_)
|
_Py_COMMON_FIELDS(fc_)
|
||||||
} PyFrameConstructor;
|
} PyFrameConstructor;
|
||||||
|
|
||||||
/* Function objects and code objects should not be confused with each other:
|
/* Function objects and code objects should not be confused with each other:
|
||||||
@ -35,7 +35,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
PyObject_HEAD
|
PyObject_HEAD
|
||||||
COMMON_FIELDS(func_)
|
_Py_COMMON_FIELDS(func_)
|
||||||
PyObject *func_doc; /* The __doc__ attribute, can be anything */
|
PyObject *func_doc; /* The __doc__ attribute, can be anything */
|
||||||
PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */
|
PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */
|
||||||
PyObject *func_weakreflist; /* List of weak references */
|
PyObject *func_weakreflist; /* List of weak references */
|
||||||
@ -60,6 +60,8 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
} PyFunctionObject;
|
} PyFunctionObject;
|
||||||
|
|
||||||
|
#undef _Py_COMMON_FIELDS
|
||||||
|
|
||||||
PyAPI_DATA(PyTypeObject) PyFunction_Type;
|
PyAPI_DATA(PyTypeObject) PyFunction_Type;
|
||||||
|
|
||||||
#define PyFunction_Check(op) Py_IS_TYPE((op), &PyFunction_Type)
|
#define PyFunction_Check(op) Py_IS_TYPE((op), &PyFunction_Type)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user