summaryrefslogtreecommitdiffstats
path: root/libdm/datastruct
diff options
context:
space:
mode:
authorAlasdair Kergon <agk@redhat.com>2003-04-15 13:24:42 +0000
committerAlasdair Kergon <agk@redhat.com>2003-04-15 13:24:42 +0000
commitb896caa19bf99db0e6c78a0f15aa8c149e858e1e (patch)
tree48017d3585e8c9dc231911a217064ebeb6e9f051 /libdm/datastruct
parent5beb6fab74b82248bd63318eff47392b9be9b13d (diff)
downloadlvm2-b896caa19bf99db0e6c78a0f15aa8c149e858e1e.tar.gz
lvm2-b896caa19bf99db0e6c78a0f15aa8c149e858e1e.tar.xz
lvm2-b896caa19bf99db0e6c78a0f15aa8c149e858e1e.zip
Improve build robustness.
Diffstat (limited to 'libdm/datastruct')
-rw-r--r--libdm/datastruct/list.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/libdm/datastruct/list.h b/libdm/datastruct/list.h
index 0c6ca405..3084e88b 100644
--- a/libdm/datastruct/list.h
+++ b/libdm/datastruct/list.h
@@ -76,8 +76,11 @@ static inline unsigned int list_size(const struct list *head)
#define list_item(v, t) \
((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->list))
-/* Given a known element in a known structure, locate the struct list */
-#define list_head(v, t, e) \
- (((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->e))->list)
+/* Given a known element in a known structure, locate another */
+#define struct_field(v, t, e, f) \
+ (((t *)((uintptr_t)(v) - (uintptr_t)&((t *) 0)->e))->f)
+
+/* Given a known element in a known structure, locate the list head */
+#define list_head(v, t, e) struct_field(v, t, e, list)
#endif