Skip to content

Commit 3d22bd2

Browse files
elmarcomstsirkin
authored andcommitted
libvhost-user: drop qemu/osdep.h dependency
Signed-off-by: Marc-André Lureau <[email protected]> Message-Id: <[email protected]> Reviewed-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 7fa1d61 commit 3d22bd2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

contrib/libvhost-user/libvhost-user-glib.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@
1212
* later. See the COPYING file in the top-level directory.
1313
*/
1414

15-
#include "qemu/osdep.h"
16-
1715
#include "libvhost-user-glib.h"
1816

17+
#ifndef container_of
18+
#define container_of(ptr, type, member) \
19+
__extension__({ \
20+
void *__mptr = (void *)(ptr); \
21+
((type *)(__mptr - offsetof(type, member))); \
22+
})
23+
#endif
24+
1925
/* glib event loop integration for libvhost-user and misc callbacks */
2026

2127
G_STATIC_ASSERT((int)G_IO_IN == (int)VU_WATCH_IN);

0 commit comments

Comments
 (0)