|
@@ -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);
|