Move 'likely' macros to the compiler support header
This makes it easier to move away from autoconfig in the future. Also, use '!!' C trick to prevent accidental incorrect usage of these macros.
This commit is contained in:
parent
cac7ba136c
commit
ff2968df3f
4 changed files with 43 additions and 11 deletions
|
@ -335,17 +335,8 @@ AH_BOTTOM([#if C_ATTRIBUTE_FASTCALL
|
|||
#define DB_FASTCALL
|
||||
#endif])
|
||||
|
||||
|
||||
AH_BOTTOM([#if C_HAS_ATTRIBUTE
|
||||
#define GCC_ATTRIBUTE(x) __attribute__ ((x))
|
||||
#else
|
||||
#define GCC_ATTRIBUTE(x) /* attribute not supported */
|
||||
#endif])
|
||||
|
||||
AH_BOTTOM([#if C_HAS_BUILTIN_EXPECT
|
||||
#define GCC_UNLIKELY(x) __builtin_expect((x),0)
|
||||
#define GCC_LIKELY(x) __builtin_expect((x),1)
|
||||
#else
|
||||
#define GCC_UNLIKELY(x) (x)
|
||||
#define GCC_LIKELY(x) (x)
|
||||
#endif])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue