about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/types.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/types.h b/include/types.h
index e7ff131d..647044c4 100644
--- a/include/types.h
+++ b/include/types.h
@@ -154,15 +154,19 @@ typedef int64_t s64;
 #define MEM_BARRIER() __asm__ volatile("" ::: "memory")
 
 #if __GNUC__ < 6
-#define likely(_x) (_x)
-#define unlikely(_x) (_x)
+# ifndef likely
+#  define likely(_x) (_x)
+# endif
+# ifndef unlikely
+#  define unlikely(_x) (_x)
+# endif
 #else
-#ifndef likely
-#define likely(_x) __builtin_expect(!!(_x), 1)
-#endif
-#ifndef unlikely
-#define unlikely(_x) __builtin_expect(!!(_x), 0)
-#endif
+# ifndef likely
+#  define likely(_x) __builtin_expect(!!(_x), 1)
+# endif
+# ifndef unlikely
+#  define unlikely(_x) __builtin_expect(!!(_x), 0)
+# endif
 #endif
 
 #endif                                                   /* ! _HAVE_TYPES_H */