]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-118207: Rename the COMMON_FIELDS macro in funcobject.h and undef it after...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 26 Apr 2024 05:29:45 +0000 (07:29 +0200)
committerGitHub <noreply@github.com>
Fri, 26 Apr 2024 05:29:45 +0000 (22:29 -0700)
gh-118207: Rename the COMMON_FIELDS macro in funcobject.h and undef it after use (GH-118208)
(cherry picked from commit 796b3fb28057948ea5b98f7eb0c0f3af6a1e276e)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
Include/cpython/funcobject.h

index 6f78f5868d0166be3d475e6e78642f4025c2938b..23c8009c38d2804ac07ca87baa8dc6f552b0499f 100644 (file)
@@ -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)