From d020acd771c927e107cab628716c09aed7b249a7 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 28 Jan 2019 09:09:57 -0500 Subject: [PATCH] qemu/compiler: Define likely() and unlikely() preprocessor macros if they don't exist Makes the code more functional with MSVC --- qemu/include/qemu/compiler.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qemu/include/qemu/compiler.h b/qemu/include/qemu/compiler.h index d3ab33c8..3898b533 100644 --- a/qemu/include/qemu/compiler.h +++ b/qemu/include/qemu/compiler.h @@ -62,6 +62,14 @@ #endif #endif +#ifndef likely +#define likely(x) (x) +#endif + +#ifndef unlikely +#define unlikely(x) (x) +#endif + #define sizeof_field(type, field) sizeof(((type *)0)->field) static double rint( double x )