This was somehow missed when I ported all the DevPrivateKey
variables in the source tree. Maybe because it didn't use the
proper DevPrivateKey but rather hardcoded the type, so grep din't
find it. And I can see why the type was hardcoded: because it's
not possible to include privates.h in the file: privates.h depends
on dix.h which depends on cursor.h which needs the definition from
privates.h.

This patch is a) ugly and b) breaks API. So beware of that when
you merge it.
---

Could you try if this patch helps? Maybe someone can in the meantime come up with a better idea how to untangle the headers.

 dix/globals.c    |    3 ++-
 include/cursor.h |    5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)


diff --git a/dix/globals.c b/dix/globals.c
index 2585798..d922e02 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -142,7 +142,8 @@ CursorPtr rootCursor;
 Bool party_like_its_1989 = FALSE;
 Bool whiteRoot = FALSE;
 
-int cursorScreenDevPriv[MAXSCREENS];
+static int cursorScreenDevPrivIndex[MAXSCREENS];
+DevPrivateKey *cursorScreenDevPriv = &cursorScreenDevPrivIndex;
 
 TimeStamp currentTime;
 TimeStamp lastDeviceEventTime;
diff --git a/include/cursor.h b/include/cursor.h
index acc95c3..490e945 100644
--- a/include/cursor.h
+++ b/include/cursor.h
@@ -64,7 +64,10 @@ struct _DeviceIntRec;
 typedef struct _Cursor *CursorPtr;
 typedef struct _CursorMetric *CursorMetricPtr;
 
-extern _X_EXPORT int cursorScreenDevPriv[MAXSCREENS];
+/* Because of cyclic references in headers, it's not possible to include
+ * privates.h in this header. Hence we need to hardcode DevPrivateKey to
+ * its actualy type. */
+extern _X_EXPORT int **cursorScreenDevPriv;
 #define CursorScreenKey(pScreen) (cursorScreenDevPriv + (pScreen)->myNum)
 
 extern _X_EXPORT CursorPtr rootCursor;

_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to