summaryrefslogtreecommitdiff
path: root/osdep.h
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-09-12 09:58:46 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-09-12 09:58:46 +0000
commit4085885616ac2613abac5c2316c488d5a12c3d0d (patch)
tree473f3526679357d55f0034fa8ebe3f9dea1a534d /osdep.h
parentec58ce9f410d6a8c59612b6cfcdd153b13a65431 (diff)
downloadqemu-4085885616ac2613abac5c2316c488d5a12c3d0d.tar.gz
qemu-4085885616ac2613abac5c2316c488d5a12c3d0d.tar.bz2
qemu-4085885616ac2613abac5c2316c488d5a12c3d0d.zip
Fix a Sparse warning about redefinition of offsetof()
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'osdep.h')
-rw-r--r--osdep.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/osdep.h b/osdep.h
index 32ee94b5ad..4b4aad4d49 100644
--- a/osdep.h
+++ b/osdep.h
@@ -2,6 +2,7 @@
#define QEMU_OSDEP_H
#include <stdarg.h>
+#include <stddef.h>
#ifdef __OpenBSD__
#include <sys/types.h>
#include <sys/signal.h>
@@ -27,7 +28,7 @@
#define unlikely(x) __builtin_expect(!!(x), 0)
#endif
-#ifndef offsetof
+#ifdef CONFIG_NEED_OFFSETOF
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *) 0)->MEMBER)
#endif
#ifndef container_of