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
|
#define NORETURN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__has_builtin)
|
#if ( __GNUC__ >= 3 )
|
||||||
#if __has_builtin(__builtin_expect)
|
#define unlikely(x) __builtin_expect(x, 0)
|
||||||
#define unlikely(x) __builtin_expect(x, 0)
|
#define likely(x) __builtin_expect(x, 1)
|
||||||
#define likely(x) __builtin_expect(x, 1)
|
#elif defined( __has_builtin )
|
||||||
#else // __has_builtin(__builtin_expect)
|
#if __has_builtin( __builtin_expect )
|
||||||
#define unlikely(x) (x)
|
#define unlikely(x) __builtin_expect(x, 0)
|
||||||
#define likely(x) (x)
|
#define likely(x) __builtin_expect(x, 1)
|
||||||
#endif // __has_builtin(__builtin_expect)
|
#else
|
||||||
#endif // defined(__has_builtin)
|
#define unlikely(x) (x)
|
||||||
|
#define likely(x) (x)
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define unlikely(x) (x)
|
||||||
|
#define likely(x) (x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef XASH_BIG_ENDIAN
|
#ifdef XASH_BIG_ENDIAN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user