aboutsummaryrefslogtreecommitdiffstats
path: root/internal.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-29 03:37:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-29 03:37:24 +0000
commitb67cb7502e222d4255c276bb84fef54612e23d0e (patch)
treeef426812355b511347150eef49a8e293179dcd65 /internal.h
parenta954f83b29d61c15338b8989306a85703e1c9e34 (diff)
downloadruby-b67cb7502e222d4255c276bb84fef54612e23d0e.tar.gz
internal.h: fix LIKELY
* internal.h (LIKELY, UNLIKELY): inverted conditions generate wrong code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal.h b/internal.h
index a9b3ee4824..06f61d85fe 100644
--- a/internal.h
+++ b/internal.h
@@ -25,8 +25,8 @@ extern "C" {
/* likely */
#if __GNUC__ >= 3
-#define LIKELY(x) (__builtin_expect(!(x), 0))
-#define UNLIKELY(x) (__builtin_expect(!(x), 1))
+#define LIKELY(x) (__builtin_expect(!!(x), 1))
+#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
#else /* __GNUC__ >= 3 */
#define LIKELY(x) (x)
#define UNLIKELY(x) (x)