зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
ef9d9423cc
Коммит
6ef6757e46
|
@ -25,8 +25,8 @@ extern "C" {
|
||||||
|
|
||||||
/* likely */
|
/* likely */
|
||||||
#if __GNUC__ >= 3
|
#if __GNUC__ >= 3
|
||||||
#define LIKELY(x) (__builtin_expect(!(x), 0))
|
#define LIKELY(x) (__builtin_expect(!!(x), 1))
|
||||||
#define UNLIKELY(x) (__builtin_expect(!(x), 1))
|
#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
|
||||||
#else /* __GNUC__ >= 3 */
|
#else /* __GNUC__ >= 3 */
|
||||||
#define LIKELY(x) (x)
|
#define LIKELY(x) (x)
|
||||||
#define UNLIKELY(x) (x)
|
#define UNLIKELY(x) (x)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче