mirror of
https://github.com/isar/libmdbx.git
synced 2025-04-28 07:42:26 +08:00
mdbx: more __has_builtin().
Change-Id: Ie23e170e12d96ad47bf2f25c7dde974673109b54
This commit is contained in:
parent
2bfcbe980e
commit
6184024a80
@ -154,7 +154,7 @@
|
|||||||
#endif /* __fallthrough */
|
#endif /* __fallthrough */
|
||||||
|
|
||||||
#ifndef __unreachable
|
#ifndef __unreachable
|
||||||
# if __GNUC_PREREQ(4,5)
|
# if __GNUC_PREREQ(4,5) || __has_builtin(__builtin_unreachable)
|
||||||
# define __unreachable() __builtin_unreachable()
|
# define __unreachable() __builtin_unreachable()
|
||||||
# elif defined(_MSC_VER)
|
# elif defined(_MSC_VER)
|
||||||
# define __unreachable() __assume(0)
|
# define __unreachable() __assume(0)
|
||||||
@ -294,7 +294,7 @@
|
|||||||
#endif /* __flatten */
|
#endif /* __flatten */
|
||||||
|
|
||||||
#ifndef likely
|
#ifndef likely
|
||||||
# if (defined(__GNUC__) || defined(__clang__)) && !defined(__COVERITY__)
|
# if (defined(__GNUC__) || __has_builtin(__builtin_expect)) && !defined(__COVERITY__)
|
||||||
# define likely(cond) __builtin_expect(!!(cond), 1)
|
# define likely(cond) __builtin_expect(!!(cond), 1)
|
||||||
# else
|
# else
|
||||||
# define likely(x) (x)
|
# define likely(x) (x)
|
||||||
@ -302,7 +302,7 @@
|
|||||||
#endif /* likely */
|
#endif /* likely */
|
||||||
|
|
||||||
#ifndef unlikely
|
#ifndef unlikely
|
||||||
# if (defined(__GNUC__) || defined(__clang__)) && !defined(__COVERITY__)
|
# if (defined(__GNUC__) || __has_builtin(__builtin_expect)) && !defined(__COVERITY__)
|
||||||
# define unlikely(cond) __builtin_expect(!!(cond), 0)
|
# define unlikely(cond) __builtin_expect(!!(cond), 0)
|
||||||
# else
|
# else
|
||||||
# define unlikely(x) (x)
|
# define unlikely(x) (x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user