aboutsummaryrefslogtreecommitdiff
path: root/miner.h
diff options
context:
space:
mode:
Diffstat (limited to 'miner.h')
-rw-r--r--miner.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/miner.h b/miner.h
index 0781ce7..e72404f 100644
--- a/miner.h
+++ b/miner.h
@@ -87,12 +87,14 @@ enum {
};
#endif
-#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
#undef unlikely
-#define unlikely(expr) (__builtin_expect((expr), 0))
+#undef likely
+#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
+#define unlikely(expr) (__builtin_expect(!!(expr), 0))
+#define likely(expr) (__builtin_expect(!!(expr), 1))
#else
-#undef unlikely
#define unlikely(expr) (expr)
+#define likely(expr) (expr)
#endif
#if defined(__i386__)