implement offsetof using gcc builtin.

Signed-off-by: Michael S. Tsirkin <m...@redhat.com>
---
 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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to