Disable LIKELY and UNLIKELY for 32bit builds using gcc >= 7

This commit is contained in:
heckflosse
2018-01-24 20:05:34 +01:00
parent f5bd232cd2
commit ff20dd1a4d

View File

@@ -55,8 +55,13 @@
#ifdef __GNUC__
#define RESTRICT __restrict__
#define LIKELY(x) __builtin_expect (!!(x), 1)
#define UNLIKELY(x) __builtin_expect (!!(x), 0)
#if __SIZEOF_POINTER__ == 4 && __GNUC__ >= 7 // there seems to be a bug with __builtin_expect on 32bit systems when using gcc >= 7
#define LIKELY(x) (x)
#define UNLIKELY(x) (x)
#else
#define LIKELY(x) __builtin_expect (!!(x), 1)
#define UNLIKELY(x) __builtin_expect (!!(x), 0)
#endif
#if (!defined(WIN32) || defined( __x86_64__ ))
#define ALIGNED64 __attribute__ ((aligned (64)))
#define ALIGNED16 __attribute__ ((aligned (16)))