From: Christian Brauner Date: Sat, 20 Feb 2021 00:32:49 +0000 (+0100) Subject: compiler: add likely() and unlikely() support X-Git-Tag: lxc-5.0.0~274^2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45069107aa81495e96b57156fa49e6afe13f8208;p=thirdparty%2Flxc.git compiler: add likely() and unlikely() support Signed-off-by: Christian Brauner --- 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 */