Issue #6151: Make PyDescr_COMMON conform to standard C.
diff --git a/Include/descrobject.h b/Include/descrobject.h
index f06b421..7c42808 100644
--- a/Include/descrobject.h
+++ b/Include/descrobject.h
@@ -37,15 +37,17 @@
/* Various kinds of descriptor objects */
-#define PyDescr_COMMON \
- PyObject_HEAD \
- PyTypeObject *d_type; \
- PyObject *d_name
-
typedef struct {
- PyDescr_COMMON;
+ PyObject_HEAD
+ PyTypeObject *d_type;
+ PyObject *d_name;
} PyDescrObject;
+#define PyDescr_COMMON PyDescrObject d_common
+
+#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
+#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
+
typedef struct {
PyDescr_COMMON;
PyMethodDef *d_method;