diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-29 11:35:39 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-29 11:35:39 +0300 |
commit | f24147d4598862a667ebd414e65a6872f78aed69 (patch) | |
tree | b34ff58b0501ad4d231838262347adff6fa2ff34 | |
parent | 068b61e5e923f4619be927bf0a08f9afcaa78d9b (diff) | |
parent | b00819bcca0c7b98af7e7e1717ccbedc2a426d57 (diff) |
Merge branch 'master' into blender2.8
-rw-r--r-- | intern/atomic/intern/atomic_ops_ext.h | 2 | ||||
-rw-r--r-- | intern/atomic/intern/atomic_ops_utils.h | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/intern/atomic/intern/atomic_ops_ext.h b/intern/atomic/intern/atomic_ops_ext.h index 1b1fea9642d..9c3104108b1 100644 --- a/intern/atomic/intern/atomic_ops_ext.h +++ b/intern/atomic/intern/atomic_ops_ext.h @@ -206,7 +206,7 @@ ATOMIC_INLINE float atomic_add_and_fetch_fl(float *p, const float x) oldval = *p; newval = oldval + x; prevval = atomic_cas_uint32((uint32_t *)p, *(uint32_t *)(&oldval), *(uint32_t *)(&newval)); - } while (UNLIKELY(prevval != *(uint32_t *)(&oldval))); + } while (_ATOMIC_UNLIKELY(prevval != *(uint32_t *)(&oldval))); return newval; } diff --git a/intern/atomic/intern/atomic_ops_utils.h b/intern/atomic/intern/atomic_ops_utils.h index 621b3e95906..413983bc9a6 100644 --- a/intern/atomic/intern/atomic_ops_utils.h +++ b/intern/atomic/intern/atomic_ops_utils.h @@ -66,14 +66,12 @@ # define ATOMIC_INLINE static inline __attribute__((always_inline)) #endif -#ifndef LIKELY -# ifdef __GNUC__ -# define LIKELY(x) __builtin_expect(!!(x), 1) -# define UNLIKELY(x) __builtin_expect(!!(x), 0) -# else -# define LIKELY(x) (x) -# define UNLIKELY(x) (x) -# endif +#ifdef __GNUC__ +# define _ATOMIC_LIKELY(x) __builtin_expect(!!(x), 1) +# define _ATOMIC_UNLIKELY(x) __builtin_expect(!!(x), 0) +#else +# define _ATOMIC_LIKELY(x) (x) +# define _ATOMIC_UNLIKELY(x) (x) #endif #if defined(__SIZEOF_POINTER__) |