mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
Fix a Sparse warning about redefinition of offsetof()
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
72cf2d4f0e
commit
de5071c551
2 changed files with 17 additions and 1 deletions
3
osdep.h
3
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue