Unlikely fixes
This commit is contained in:
35
patches/unlikely
Normal file
35
patches/unlikely
Normal file
@@ -0,0 +1,35 @@
|
||||
Index: libffi/ChangeLog
|
||||
===================================================================
|
||||
--- libffi.orig/ChangeLog
|
||||
+++ libffi/ChangeLog
|
||||
@@ -1,3 +1,8 @@
|
||||
+2012-01-23 Anthony Green <green@moxielogic.com>
|
||||
+ Dmitry Nadezhin <dmitry.nadezhin@gmail.com>
|
||||
+
|
||||
+ * include/ffi_common.h (LIKELY, UNLIKELY): Fix definitions.
|
||||
+
|
||||
2012-01-23 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
* src/m68k/sysv.S (ffi_call_SYSV): Properly test for plain
|
||||
Index: libffi/include/ffi_common.h
|
||||
===================================================================
|
||||
--- libffi.orig/include/ffi_common.h
|
||||
+++ libffi/include/ffi_common.h
|
||||
@@ -1,5 +1,5 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
- ffi_common.h - Copyright (C) 2011 Anthony Green
|
||||
+ ffi_common.h - Copyright (C) 2011, 2012 Anthony Green
|
||||
Copyright (C) 2007 Free Software Foundation, Inc
|
||||
Copyright (c) 1996 Red Hat, Inc.
|
||||
|
||||
@@ -118,8 +118,8 @@ typedef float FLOAT32;
|
||||
#ifndef __GNUC__
|
||||
#define __builtin_expect(x, expected_value) (x)
|
||||
#endif
|
||||
-#define LIKELY(x) __builtin_expect((x),1)
|
||||
-#define UNLIKELY(x) __builtin_expect((x),1)
|
||||
+#define LIKELY(x) __builtin_expect(!!(x),1)
|
||||
+#define UNLIKELY(x) __builtin_expect((x)!=0,0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
Reference in New Issue
Block a user