aboutsummaryrefslogtreecommitdiff
path: root/syshead.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--syshead.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/syshead.h b/syshead.h
index e6ced2a..07f1970 100644
--- a/syshead.h
+++ b/syshead.h
@@ -36,6 +36,15 @@
#endif
#endif
+/* branch prediction hints */
+#if defined(__GNUC__)
+# define likely(x) __builtin_expect((x),1)
+# define unlikely(x) __builtin_expect((x),0)
+#else
+# define likely(x) (x)
+# define unlikely(x) (x)
+#endif
+
#if defined(_WIN32) && !defined(WIN32)
#define WIN32
#endif