Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/netbsd-8]: xsrc/external/mit/xf86-video-intel/dist/src Pull up followin...
details: https://anonhg.NetBSD.org/xsrc/rev/3ca31611b04a
branches: netbsd-8
changeset: 10358:3ca31611b04a
user: martin <martin%NetBSD.org@localhost>
date: Mon Jul 15 08:26:10 2019 +0000
description:
Pull up following revision(s) (requested by mrg in ticket #1290):
external/mit/xf86-video-intel/dist/src/intel_list.h: revision 1.2
merge changes from xorg-server 1.20 list.h into this older version.
fixes sandy bridge crashing problems for me.
diffstat:
external/mit/xf86-video-intel/dist/src/intel_list.h | 26 ++++++++++++++++----
1 files changed, 20 insertions(+), 6 deletions(-)
diffs (54 lines):
diff -r 1b6e01b0b15e -r 3ca31611b04a external/mit/xf86-video-intel/dist/src/intel_list.h
--- a/external/mit/xf86-video-intel/dist/src/intel_list.h Tue Aug 28 13:27:24 2018 +0000
+++ b/external/mit/xf86-video-intel/dist/src/intel_list.h Mon Jul 15 08:26:10 2019 +0000
@@ -305,9 +305,20 @@
#define list_last_entry(ptr, type, member) \
list_entry((ptr)->prev, type, member)
-#define __container_of(ptr, sample, member) \
- (void *)((char *)(ptr) \
- - ((char *)&(sample)->member - (char *)(sample)))
+#ifdef HAVE_TYPEOF
+#define __container_of(ptr, sample, member) \
+ container_of(ptr, typeof(*sample), member)
+#else
+/* This implementation of __container_of has undefined behavior according
+ * to the C standard, but it works in many cases. If your compiler doesn't
+ * support typeof() and fails with this implementation, please try a newer
+ * compiler.
+ */
+#define __container_of(ptr, sample, member) \
+ (void *)((char *)(ptr) \
+ - ((char *)&(sample)->member - (char *)(sample)))
+#endif
+
/**
* Loop through the list given by head and set pos to struct in the list.
*
@@ -326,12 +337,14 @@
*
*/
#define list_for_each_entry(pos, head, member) \
- for (pos = __container_of((head)->next, pos, member); \
+ for (pos = NULL, \
+ pos = __container_of((head)->next, pos, member); \
&pos->member != (head); \
pos = __container_of(pos->member.next, pos, member))
#define list_for_each_entry_reverse(pos, head, member) \
- for (pos = __container_of((head)->prev, pos, member); \
+ for (pos = NULL, \
+ pos = __container_of((head)->prev, pos, member); \
&pos->member != (head); \
pos = __container_of(pos->member.prev, pos, member))
@@ -343,7 +356,8 @@
* See list_for_each_entry for more details.
*/
#define list_for_each_entry_safe(pos, tmp, head, member) \
- for (pos = __container_of((head)->next, pos, member), \
+ for (pos = NULL, \
+ pos = __container_of((head)->next, pos, member), \
tmp = __container_of(pos->member.next, pos, member); \
&pos->member != (head); \
pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
Home |
Main Index |
Thread Index |
Old Index