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:
parent
53e301a2d8
commit
ef9d9423cc
2 changed files with 6 additions and 2 deletions
|
@ -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>
|
||||
|
||||
* gc.c: document argument passed to finalizer proc.
|
||||
|
|
|
@ -25,8 +25,8 @@ extern "C" {
|
|||
|
||||
/* likely */
|
||||
#if __GNUC__ >= 3
|
||||
#define LIKELY(x) (__builtin_expect((x), 1))
|
||||
#define UNLIKELY(x) (__builtin_expect((x), 0))
|
||||
#define LIKELY(x) (__builtin_expect(!(x), 0))
|
||||
#define UNLIKELY(x) (__builtin_expect(!(x), 1))
|
||||
#else /* __GNUC__ >= 3 */
|
||||
#define LIKELY(x) (x)
|
||||
#define UNLIKELY(x) (x)
|
||||
|
|
Loading…
Reference in a new issue