OSDN Git Service

libvhost-user: remove qemu/compiler.h usage
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 25 Nov 2020 10:06:35 +0000 (14:06 +0400)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 8 Dec 2020 18:48:58 +0000 (13:48 -0500)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20201125100640.366523-4-marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
contrib/libvhost-user/libvhost-user.c

index 54aabd1..fab7ca1 100644 (file)
@@ -27,7 +27,6 @@
 #include <sys/eventfd.h>
 #include <sys/mman.h>
 #include <endian.h>
-#include "qemu/compiler.h"
 
 #if defined(__linux__)
 #include <sys/syscall.h>
 /* Round number up to multiple */
 #define ALIGN_UP(n, m) ALIGN_DOWN((n) + (m) - 1, (m))
 
+#ifndef unlikely
+#define unlikely(x)   __builtin_expect(!!(x), 0)
+#endif
+
 /* Align each region to cache line size in inflight buffer */
 #define INFLIGHT_ALIGNMENT 64