diff options
Diffstat (limited to 'types.h')
-rw-r--r-- | types.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/types.h b/types.h index 784d3a7a..7606d4ed 100644 --- a/types.h +++ b/types.h @@ -78,9 +78,14 @@ typedef int64_t s64; #define STRINGIFY(x) STRINGIFY_INTERNAL(x) #define MEM_BARRIER() \ - asm volatile("" ::: "memory") + __asm__ volatile("" ::: "memory") -#define likely(_x) __builtin_expect(!!(_x), 1) -#define unlikely(_x) __builtin_expect(!!(_x), 0) +#if __GNUC__ < 6 + #define likely(_x) (_x) + #define unlikely(_x) (_x) +#else + #define likely(_x) __builtin_expect(!!(_x), 1) + #define unlikely(_x) __builtin_expect(!!(_x), 0) +#endif #endif /* ! _HAVE_TYPES_H */ |