From 45069107aa81495e96b57156fa49e6afe13f8208 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 20 Feb 2021 01:32:49 +0100 Subject: [PATCH] compiler: add likely() and unlikely() support Signed-off-by: Christian Brauner --- src/lxc/compiler.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lxc/compiler.h b/src/lxc/compiler.h index 755c21d52..89286eab6 100644 --- a/src/lxc/compiler.h +++ b/src/lxc/compiler.h @@ -85,4 +85,7 @@ #define __public __attribute__((visibility("default"))) #endif +#define likely(x) __builtin_expect(!!(x), 1) +#define unlikely(x) __builtin_expect(!!(x), 0) + #endif /* __LXC_COMPILER_H */ -- 2.47.2