1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

internal.h: ensure a boolean

* internal.h (LIKELY, UNLIKELY): make a boolean to enforce 1 or 0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-07-29 02:13:00 +00:00
parent 53e301a2d8
commit ef9d9423cc
2 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Wed Jul 29 11:07:10 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* internal.h (LIKELY, UNLIKELY): make a boolean to enforce 1 or 0.
Wed Jul 29 10:44:43 2015 Alex Dowad <alexinbeijing@gmail.com> Wed Jul 29 10:44:43 2015 Alex Dowad <alexinbeijing@gmail.com>
* gc.c: document argument passed to finalizer proc. * gc.c: document argument passed to finalizer proc.

View file

@ -25,8 +25,8 @@ extern "C" {
/* likely */ /* likely */
#if __GNUC__ >= 3 #if __GNUC__ >= 3
#define LIKELY(x) (__builtin_expect((x), 1)) #define LIKELY(x) (__builtin_expect(!(x), 0))
#define UNLIKELY(x) (__builtin_expect((x), 0)) #define UNLIKELY(x) (__builtin_expect(!(x), 1))
#else /* __GNUC__ >= 3 */ #else /* __GNUC__ >= 3 */
#define LIKELY(x) (x) #define LIKELY(x) (x)
#define UNLIKELY(x) (x) #define UNLIKELY(x) (x)