libvhost-user: drop qemu/osdep.h dependency

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20201125100640.366523-5-marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Marc-André Lureau 2020-11-25 14:06:36 +04:00 committed by Michael S. Tsirkin
parent 7fa1d61695
commit 3d22bd27ac

View File

@ -12,10 +12,16 @@
* later. See the COPYING file in the top-level directory. * later. See the COPYING file in the top-level directory.
*/ */
#include "qemu/osdep.h"
#include "libvhost-user-glib.h" #include "libvhost-user-glib.h"
#ifndef container_of
#define container_of(ptr, type, member) \
__extension__({ \
void *__mptr = (void *)(ptr); \
((type *)(__mptr - offsetof(type, member))); \
})
#endif
/* glib event loop integration for libvhost-user and misc callbacks */ /* glib event loop integration for libvhost-user and misc callbacks */
G_STATIC_ASSERT((int)G_IO_IN == (int)VU_WATCH_IN); G_STATIC_ASSERT((int)G_IO_IN == (int)VU_WATCH_IN);