summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-06-14 11:31:40 +0100
committerOwain G. Ainsworth <oga@openbsd.org>2010-06-14 17:38:02 +0100
commit3a4e72daee2e89054d588a5fabf690b9f15705c6 (patch)
treea8bc6e75a0f40fcfbc1798ea11a62ffbf27cd5a6
parent4c3ea7377db46defdbcde87c7f906bbd145c36e8 (diff)
Compile fix for alternate list.h from xserver-1.9
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (cherry picked from commit 84d65bace521ad80b9bede4ae9e3e2a8d0668b90) Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
-rw-r--r--src/i830.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/i830.h b/src/i830.h
index 4d46d7b7..f16a9c40 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -78,6 +78,15 @@ void i830_uxa_block_handler(ScreenPtr pScreen);
Bool i830_get_aperture_space(ScrnInfoPtr scrn, drm_intel_bo ** bo_table,
int num_bos);
+/* XXX
+ * The X server gained an *almost* identical implementation in 1.9.
+ *
+ * Remove this duplicate code either in 2.16 (when we can depend upon 1.9)
+ * or the drivers are merged back into the xserver tree, whichever happens
+ * earlier.
+ */
+
+#ifndef _LIST_H_
/* classic doubly-link circular list */
struct list {
struct list *next, *prev;
@@ -125,25 +134,35 @@ list_is_empty(struct list *head)
{
return head->next == head;
}
+#endif
#ifndef container_of
#define container_of(ptr, type, member) \
(type *)((char *)(ptr) - (char *) &((type *)0)->member)
#endif
+#ifndef list_entry
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)
+#endif
+#ifndef list_first_entry
#define list_first_entry(ptr, type, member) \
list_entry((ptr)->next, type, member)
+#endif
+#ifndef list_foreach
#define list_foreach(pos, head) \
for (pos = (head)->next; pos != (head); pos = pos->next)
+#endif
+/* XXX list.h from xserver-1.9 uses a GCC-ism to avoid having to pass type */
+#ifndef list_foreach_entry
#define list_foreach_entry(pos, type, head, member) \
for (pos = list_entry((head)->next, type, member);\
&pos->member != (head); \
pos = list_entry(pos->member.next, type, member))
+#endif
struct intel_pixmap {
dri_bo *bo;