summaryrefslogtreecommitdiff
path: root/urcu-list-compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'urcu-list-compat.h')
-rw-r--r--urcu-list-compat.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/urcu-list-compat.h b/urcu-list-compat.h
new file mode 100644
index 0000000..44117ad
--- /dev/null
+++ b/urcu-list-compat.h
@@ -0,0 +1,21 @@
+#ifndef URCU_LIST_COMPAT_H
+#define URCU_LIST_COMPAT_H
+
+#include <urcu/list.h>
+
+#ifndef cds_list_last_entry
+#define cds_list_last_entry(ptr, type, member) \
+ cds_list_entry((ptr)->prev, type, member)
+#endif
+
+#ifndef cds_list_next_entry
+#define cds_list_next_entry(pos, member) \
+ cds_list_entry((pos)->member.next, typeof(*(pos)), member)
+#endif
+
+#ifndef cds_list_prev_entry
+#define cds_list_prev_entry(pos, member) \
+ cds_list_entry((pos)->member.prev, typeof(*(pos)), member)
+#endif
+
+#endif /* URCU_LIST_COMPAT_H */