[PATCH 2/5] kvm-unittest: libcflat: add offsetof

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



implement offsetof using gcc builtin.

Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
---
 lib/libcflat.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/libcflat.h b/lib/libcflat.h
index 0c62e4c..e005d3a 100644
--- a/lib/libcflat.h
+++ b/lib/libcflat.h
@@ -54,4 +54,6 @@ extern void *memset(void *s, int c, size_t n);
 extern long atol(const char *ptr);
 #define ARRAY_SIZE(_a)  (sizeof(_a)/sizeof((_a)[0]))
 
+#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
+
 #endif
-- 
MST

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux