aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-03-05 02:10:05 -0500
committerMike Frysinger <vapier@gentoo.org>2012-03-06 00:16:06 -0500
commit966a8f38b21a4f862fe0bf796664d82d9553b391 (patch)
tree53fc5ee132acc8736c173e54cf0b3c6af771aec2
parentlibsandbox: push down constructor init (diff)
downloadsandbox-966a8f38b21a4f862fe0bf796664d82d9553b391.tar.gz
sandbox-966a8f38b21a4f862fe0bf796664d82d9553b391.tar.bz2
sandbox-966a8f38b21a4f862fe0bf796664d82d9553b391.zip
libsandbox: add likely/unlikely support
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--localdecls.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/localdecls.h b/localdecls.h
index 3992834..590654d 100644
--- a/localdecls.h
+++ b/localdecls.h
@@ -113,4 +113,7 @@ typedef struct user_regs_struct trace_regs;
#define attribute_hidden __attribute__((visibility("hidden")))
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
+
#endif