summaryrefslogtreecommitdiffstats
path: root/src/apk_defines.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/apk_defines.h')
-rw-r--r--src/apk_defines.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h
index 49ca9eb..c8a3622 100644
--- a/src/apk_defines.h
+++ b/src/apk_defines.h
@@ -30,6 +30,18 @@
#define NULL 0L
#endif
+#if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ < 96
+#define __builtin_expect(x, expected_value) (x)
+#endif
+
+#ifndef likely
+#define likely(x) __builtin_expect((!!(x)),1)
+#endif
+
+#ifndef unlikely
+#define unlikely(x) __builtin_expect((!!(x)),0)
+#endif
+
#ifndef container_of
#define container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \