mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
common: fix usage of __has_builtin for old GCC releases
This commit is contained in:
parent
ac9664c7ae
commit
5d4f8373c4
@ -87,15 +87,21 @@ typedef uint64_t longtime_t;
|
||||
#define NORETURN
|
||||
#endif
|
||||
|
||||
#if defined(__has_builtin)
|
||||
#if __has_builtin(__builtin_expect)
|
||||
#define unlikely(x) __builtin_expect(x, 0)
|
||||
#define likely(x) __builtin_expect(x, 1)
|
||||
#else // __has_builtin(__builtin_expect)
|
||||
#define unlikely(x) (x)
|
||||
#define likely(x) (x)
|
||||
#endif // __has_builtin(__builtin_expect)
|
||||
#endif // defined(__has_builtin)
|
||||
#if ( __GNUC__ >= 3 )
|
||||
#define unlikely(x) __builtin_expect(x, 0)
|
||||
#define likely(x) __builtin_expect(x, 1)
|
||||
#elif defined( __has_builtin )
|
||||
#if __has_builtin( __builtin_expect )
|
||||
#define unlikely(x) __builtin_expect(x, 0)
|
||||
#define likely(x) __builtin_expect(x, 1)
|
||||
#else
|
||||
#define unlikely(x) (x)
|
||||
#define likely(x) (x)
|
||||
#endif
|
||||
#else
|
||||
#define unlikely(x) (x)
|
||||
#define likely(x) (x)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef XASH_BIG_ENDIAN
|
||||
|
Loading…
x
Reference in New Issue
Block a user