Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 29 Nov 2018 08:35:39 +0000 (09:35 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 29 Nov 2018 08:35:39 +0000 (09:35 +0100)
intern/atomic/intern/atomic_ops_ext.h
intern/atomic/intern/atomic_ops_utils.h

index 1b1fea9642d430678d2fc0177f1cfe782ec9e8a9..9c3104108b1c242c6e9e2c1c2c751355c9feb25b 100644 (file)
@@ -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;
 }
index 621b3e959067c169285dcd4af8c82edbc866a475..413983bc9a60adb23840818e991c7b238b6f4778 100644 (file)
 #  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__)